Solved

Vb.net program window size

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.

863 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now