Solved

How to position the Application Window in Normal State

Posted on 2012-03-10
2
180 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
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 video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

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