Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / May 2006

Tip: Looking for answers? Try searching our database.

setting window size based on screen resolution of the system

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ShilpaM - 23 May 2006 06:55 GMT
Hai,
I am working with windows forms in vb.net. i want to adjust window(form)
size based on screen resolution of the system(Resolution is small and
large).Is it possible to change .tell me some possible answer

Regards
shilpa
Kerem OZMAN - 23 May 2006 09:06 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.