简体   繁体   中英

C# Windows Application Form to Html Form

I'm working on a project where I need to convert a C# windows application form to an HTML form programmatically.

I'm having problems with sizing the HTML text boxes appropriately. I set the width and height to the exact same width and height (in pixels) used on the winforms equivalent but it ends up being bigger than the winforms equivalent.

The other controls (label, groupbox ...) appear OK. Clues anyone?

The CSS trick for Box Sizing would come in rescue for your case:

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+ */
}

More detials you can find here: http://css-tricks.com/box-sizing/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM