Solved

Vb.net program window size

Posted on 2007-03-28
5
308 Views
Last Modified: 2013-11-26
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
Comment
Question by:dprundle
5 Comments
 
LVL 12

Expert Comment

by:craskin
ID: 18808675
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
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 500 total points
ID: 18808686
Yes...at design-time, in the IDE, set the WindowState() property to Maximized.

Done.
0
 

Expert Comment

by:ParrT
ID: 18808725
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
 

Author Comment

by:dprundle
ID: 18818218
Okay these make the window bigger but dont center the content (buttons and icons)
0
 
LVL 85

Expert Comment

by:Mike Tomlinson
ID: 18818348
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question