How can I change the size of the forms in my Windows application when the
screen resolution the user has is higher than the one I developed the
application in? I have a customer that has a screen resolution of 1600x1200
and I developed the application in a PC with 1024x768 resolution. Is it
possible to increase the forms' sizes accordingly?
Loading
Hermes CondezPosted Mar 1, 2012, 3:59 AM
private void AutoFitToScreen()
{
// Retrieve the working rectangle from the Screen class
// using the PrimaryScreen and the WorkingArea properties.
System.Drawing.Rectangle workingRectangle =
Screen.PrimaryScreen.WorkingArea;
int newHeight = workingRectangle.Height;
int newWidth = workingRectangle.Width;
}SenthilkumarPosted Mar 1, 2012, 3:13 AM
int wid = System.Windows.Forms.Screen.GetBounds().Width;
int height = System.Windows.Forms.Screen.GetBounds().Height;