Resize a form depending on the screen resolution

  • Thread starter Thread starter touf
  • Start date Start date
T

touf

Hi,
I've developped an application on a machine that have 1280,1024 , the forms
look ok,
WhenI change the resolution to 1024,768 the forms are biggest than the
screen.

Is there a way to resize the form depending on the screen resolution ?

Thanks
 
I dont think there is anything of that kind. In the
application start up, U can set the size of the MDI form
based on the screen resolution and child windows can fit
into it.
 
What about the controls?

I mean that if the form size become 2/3 of the original size, tha controls
size will follow.
 
Hi,
Instead of trying so many things why don't you add a line of code in every
form on resize event. it is actually very simple. if you write it for one
form it can be copied and pasted every where. By the way I assume there are
10 controls on every form.

Regards
Kishor
 
Hi, thanks everyone
Kishor, can you explain me more about the code that can be added to the
resize event , please

Thanks
 
Hello,

touf said:
Is there a way to resize the form depending on the screen
resolution ?

Have a look at the form's 'Scale' method.

Monitor size:

SystemInformation.PrimaryMonitorSize
SystemInformation.WorkingArea
SystemInformation.VirtualScreen
Screen.PrimaryScreen.Bounds
Screen.PrimaryScreen.WorkingArea

When using multiple monitors:

Screen.AllScreens
 
Hi,
U can handle control re-sizing by using the Anchor
property of the controls efficiently.

Regards
Mahesh
 
Back
Top