Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How to position the Application Window in Normal State

Posted on 2012-03-10
2
Medium Priority
?
187 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 86

Assisted Solution

by:Mike Tomlinson
Mike Tomlinson earned 1000 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 1000 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses
Course of the Month21 days, 5 hours left to enroll

810 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