Solved

How to position the Application Window in Normal State

Posted on 2012-03-10
2
179 Views
Last Modified: 2012-03-22
When I have my VB.NET application maximised and then pres the upper right icon that brings it into the Normal mode (FormWindowState.Normal) it always posistion itself at a predefined posistion. The Width and Height is also predefined. Quite often these values are not desirable.

Where are these values stored? It must be possible to change them into something more appropriate during runtime or startup?

Is it possible to reuse these values next time the program is opend?
0
Comment
Question by:daghoff
2 Comments
 
LVL 85

Assisted Solution

by:Mike Tomlinson
Mike Tomlinson earned 250 total points
ID: 37705696
The size defaults to the size of the form at design-time.  If you want it to appear at a particular location then set the StartPosition() property to "Manual" and set a Location().
0
 
LVL 9

Accepted Solution

by:
lojk earned 250 total points
ID: 37705850
I personally recommend setting the form to Center Screen or Center Owner rather than manual as that is more in line with user expectation.

If you do want it to be Manual and want to persist the location between runs create a setting in your application settings file and bind (using the application settings property in the properties window) the location property to it.

If you want to be a bit more dynamic about it override the OnShown method of the form and before the overridden method (Base.Onshown(e)) implement your own code to position the form.
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

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

862 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

25 Experts available now in Live!

Get 1:1 Help Now