You can use Screen class to get the screen resolution.
This sample is taken from MSDN:
' This method will adjust the size of the form to utilize
' the working area of the screen.
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
' Retrieve the working rectangle from the Screen class
' using the PrimaryScreen and the WorkingArea properties.
Dim workingRectangle As System.Drawing.Rectangle = _
Screen.PrimaryScreen.WorkingArea
' Set the size of the form slightly less than size of
' working rectangle.
Me.Size = New System.Drawing.Size(workingRectangle.Width - 10, _
workingRectangle.Height - 10)
' Set the location so the entire form is visible.
Me.Location = New System.Drawing.Point(5, 5)
End Sub
> Hai,
> I am working with windows forms in vb.net. i want to adjust window(form)
[quoted text clipped - 3 lines]
> Regards
> shilpa
ShilpaM - 23 May 2006 16:09 GMT
On my window i have a control datagrid,that size is not changing.we have to
resize datagrid also.how can we change datagrid size with window size so that
complete window will be visble with every control.
> You can use Screen class to get the screen resolution.
> This sample is taken from MSDN:
[quoted text clipped - 25 lines]
> > Regards
> > shilpa
Kerem OZMAN - 23 May 2006 18:24 GMT
Please check Anchor property of DataGrid (Almost every WinForms UI controls
have this property). It assures that the distance between the datagrid's
edges and its container control's edges (e.g a Form) remains constant even
after you resize the container.
> On my window i have a control datagrid,that size is not changing.we have
> to
[quoted text clipped - 32 lines]
>> > Regards
>> > shilpa