简体   繁体   中英

Winforms app controls change size on production PC

I'm developing a small winforms app for internal use. My dev pc runs Windows 7 however most of the other team members (ie the users of the app) are running Windows 8.1. The winforms controls all render slightly differently in Windows 8.1 and this causes some problems such as buttons cutting off text due to size differences.

Is there a way to see how the app will render in Windows 8.1 on my Windows 7 dev PC? Note I'm talking about a regular winforms app, not a Metro style app.

I'm developing in C# using Visual Studio Professional 2013


EDIT

Note that I have now also tried using https://github.com/viperneo/winforms-modernui and I get similar behaviour. I have a DateTimePicker next to a Button and I make their height's the same. On my Windows 7 dev PC this looks correct. However when I run it on a Windows 8 "production" PC the button height is now shorter than the DateTimePicker , things become misaligned in general and some controls even start to partially overlap. The screen resolutions of the two PCs is the same

Check to see what DPI setting that all/each of your users are using. Windows Forms will always render differently with each DPI scaling setting regardless if it is Windows 7 or Windows 8. Takes a fair bit of work in dev and testing with each major DPI increment but it can be done to get a decent look.

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