Resize a form & controls on it depending on the screen resolution
screen resolution
Collapse
X
-
-
Code:'VB Dim x, y as Int32 x = SystemInformation.PrimaryMonitorSize.Width y = SystemInformation.PrimaryMonitorSize.Height Me.Size = New Size(x - 20, y - 20)
would set your form to 20 pixels less than your resolution in both dimensions. You can use similar logic to change the size of your controls.Code://c# int x = SystemInformation.PrimaryMonitorSize.Width; int y = SystemInformation.PrimaryMonitorSize.Height; this.Size = new Size(x - 20, y - 20);
Comment
-
Here's another example from vb2005
[code=vb]
Dim a As Rectangle = Screen.PrimaryS creen.WorkingAr ea
'Size form
Me.Width = a.Width
Me.Height = a.Height
'Position form
Me.Top = 0
Me.Left = 0
[/code]Comment
Comment