Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form position

Status
Not open for further replies.

MLNorton

Programmer
Nov 15, 2009
134
US
I have a 800 x 600 Form that I want to be displayed in the upper right hand corner. If I select Align = right, the form is right justified but the height is expanded to the full screen height.

 
if you want a form in the upper right corner, then you need to put this in the formcreate of your form.

Code:
Left := screen.width - Width;
Top := 0;

You'd have to see what affect this code has for a computer with multiple monitors, whether it puts it in the right corner of your main monitor, or on the last monitor on the right. I haven't had the opportunity to check, not having multiple monitors. Also, you can first check to see if there are multiple monitors with

Code:
X := Screen.MonitorCount;
 
The align settings by default fill the dimension of the form that the setting doesn't specify. So Align = alRight resizes to the height of the screen.

You just have to place the form in the upper right hand corner.

Code:
Form1.Width := 800;
Form1.Height := 600;
Form1.Left := Screen.Width - Form1.Width;
Form1.Top := 0;

It is not possible for anyone to acknowledge truth when their salary depends on them not doing it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top