• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 314
  • Last Modified:

Vb.net program window size

When opening a dialog or program in vb.net is it possible to have the screen maximize to the screen resolution (1024x768, 800x600, etc) automatically? if so, how?
0
dprundle
Asked:
dprundle
1 Solution
 
craskinCommented:
however you're creating the window, you can usually just set .Width and .Height. this is how i do a similar thing for an IE window:

Dim ie
Set ie=createobject("internetexplorer.application")
With ie
    .navigate "about:blank"
    Do Until .readyState=4
     WScript.Sleep 10
    Loop
    .toolbar=0
    .statusbar=0
    .Top=0
    .Left=0
    .Width=ie.document.parentwindow.screen.availWidth
    .Height=ie.document.parentwindow.screen.availHeight
    .navigate "http://cachetweb"
    .visible=true
End With
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
Yes...at design-time, in the IDE, set the WindowState() property to Maximized.

Done.
0
 
ParrTCommented:
two ways:
(Maximize the screen)

dim dlg as new <yourformname>
    dlg.WindowState = FormWindowState.Maximized
dlg.showdialog ....

or to make it not maximised but to change the size to the size of the screen:

dlg.windowstate = formwindowstate.normal
 dlg.Size = Screen.PrimaryScreen.Bounds.Size

(although I am not sure why you would want to do the latter!
0
 
dprundleAuthor Commented:
Okay these make the window bigger but dont center the content (buttons and icons)
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now