Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Differing form size between XP and 7

I am developing a C# WinForms app on my XP dev machine with Visual C# Express 2008.

I set the form to have a size of my liking with Width and Height on the designer and all looks good. I also set these dimensions to the MaximumSize property.

Deploying the app to another XP machine, and the app looks like it does on my dev.

However, in testing the app on a Win7 machine, the form has both horizontal and vertical scrollbars applied. I assume that this is due to the changed non-client size of the form, as determined by Win7. I can resize the window, but I would like it to be displayed correctly to begin with.

So, my question is: What is the best way to correctly maintain a form size client area across OS'es?

Thanks all.

like image 405
Andy Avatar asked Apr 03 '10 19:04

Andy


People also ask

What's the difference between Windows XP and 7?

There are not much graphical components present in the Windows XP but Windows 7 provides good Graphical User Interface (GUI). In windows 7 there is no necessity for the drivers to be installed but in Windows XP it is necessary to install drivers.

Is Windows 7 higher than Windows XP?

Just as Windows 7 is more secure than XP, Windows 8 provides new security features designed to keep you safer. Windows 8, for example, comes with the Windows Defender program that protects your computer from malicious software.

Is Windows XP lighter than Windows 7?

Distinguished. The thing with XP is, it's lighter than 7.


1 Answers

You should make use of the ClientSize property - if you set it in code, it will not change across OS'es.

From MSDN:

The client area of a control is the bounds of the control, minus the nonclient elements such as scroll bars, borders, title bars, and menus.

like image 114
Oded Avatar answered Oct 22 '22 13:10

Oded