Solved

How to position the Application Window in Normal State

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
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.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

758 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

20 Experts available now in Live!

Get 1:1 Help Now