Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/78.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C#Windows应用程序表单到Html表单_C#_Html_Css_Winforms_Forms - Fatal编程技术网

C#Windows应用程序表单到Html表单

C#Windows应用程序表单到Html表单,c#,html,css,winforms,forms,C#,Html,Css,Winforms,Forms,我正在做一个项目,需要通过编程将C#windows应用程序表单转换为HTML表单 我在适当调整HTML文本框的大小方面遇到问题。我将宽度和高度设置为与winforms等价物上使用的宽度和高度(以像素为单位)完全相同,但它最终比winforms等价物大 其他控件(标签、组框…)显示正常。任何人的线索?框大小的CSS技巧将为您的案例提供帮助: textarea { -webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit

我正在做一个项目,需要通过编程将C#windows应用程序表单转换为HTML表单

我在适当调整HTML文本框的大小方面遇到问题。我将宽度和高度设置为与winforms等价物上使用的宽度和高度(以像素为单位)完全相同,但它最终比winforms等价物大


其他控件(标签、组框…)显示正常。任何人的线索?

框大小的CSS技巧将为您的案例提供帮助:

textarea { 
    -webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
    -moz-box-sizing: border-box;    /* Firefox, other Gecko */
    box-sizing: border-box;         /* Opera/IE 8+ */
}

您可以在此处找到更多详细信息:

您需要考虑html文本框的边框和填充。尝试添加css样式
框大小:边框框
,它将使您的框成为您指定的大小(取决于您使用的浏览器),非常感谢,Pete!工作得很好!你能把这个贴出来作为我的答案吗?