Solved

Vb.net program window size

Posted on 2007-03-28
5
307 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

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…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

773 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