Link to home
Start Free TrialLog in
Avatar of hutelihut
hutelihut

asked on

Placing a form on the secondary monitor

There is 2 monitors connected to my computer - so the desktop is "double size" (feel free to ask)

How do I place a form on the secondary screen?
Avatar of ginsonic
ginsonic
Flag of Romania image

Simple:

Form.Left:=Screen.Width+WhereYouWish;
Avatar of hutelihut
hutelihut

ASKER

Sorry, but that does'nt work
...The form is automaticly (somehow) put on the primary screen.
just a second
solution is on the way
...
ASKER CERTIFIED SOLUTION
Avatar of ILE
ILE

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
lol, ILE ;-)
Im not sure if this would work, but if you position the form at design time, when you run it the form will be created in the same spot as it was on the screen at design time.  So at design time just position the form on the second monitor, or have the delphi application open on the second monitor, etc.  I do not have 2 monitors so i cannot test this.

Hope this helps, -Josh-
Maybe you have a setting that move your form into the first monitor.

But it's imposible to don't work else. I use it now in couple applications.

Just create a new application and in FormCreate procedure add Form1.Left:= Screen.Width+10. In this case the left corner will be at 10 pixels in second screen.

If use 1024x768 resolutiom the left:=1024+10=1034. This point is somewhere outside the first monitor ( it's in the second monitor).

Try to put in Object inspector for left a value bigger than your screen width.

Let me know the test results :)
Which effect has TCustomForm.DefaultMonitor?
You would use TScreen i believe (search for TScreen in the help file).  It has the info about the available monitors, etc.  Not sure how to use it though.
Thanks. Sorry for the late reply.