?
Solved

Placing a form on the secondary monitor

Posted on 2003-03-03
11
Medium Priority
?
450 Views
1 Endorsement
Last Modified: 2010-04-04
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?
1
Comment
Question by:hutelihut
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
  • 2
  • +2
11 Comments
 
LVL 9

Expert Comment

by:ginsonic
ID: 8058931
Simple:

Form.Left:=Screen.Width+WhereYouWish;
0
 

Author Comment

by:hutelihut
ID: 8058940
Sorry, but that does'nt work
0
 

Author Comment

by:hutelihut
ID: 8058949
...The form is automaticly (somehow) put on the primary screen.
0
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!

 
LVL 3

Expert Comment

by:ILE
ID: 8059742
just a second
solution is on the way
...
0
 
LVL 3

Accepted Solution

by:
ILE earned 200 total points
ID: 8059879

this is the default monitor where form appear


form1.defaultmonitor:=
dmDesktop     No attempt is made to position the form on a specific monitor.
dmPrimary     The form is positioned on the first monitor listed in the global screen object’s Monitors property.
dmMainForm     The form appears on the same monitor as the application’s main form.
dmActiveForm     The form appears on the same monitor as the currently active form.

 defaultmonitor have no efect if application dont have a mainform


screen.monitorcount    is a variable where is the number of monitors

screen.Monitors[Index: Integer]: TMonitor;  is the all the monitors awiable to the sistem

form1.monitor prowides acces where for the monitor where form is appear;


procedure MakeFullyVisible(AMonitor: TMonitor = nil);

wery usefull comand to make shure the moinitor is tha fully visible






Applications do not create instances of TMonitor. Instead, monitor components for all available monitors are listed by the Monitors property of the global Screen variable. The global Screen variable also provides global information about the monitors on which the application runs, such as screen resolution, available fonts, and so on.

0
 
LVL 5

Expert Comment

by:Lukasz Lach
ID: 8060018
lol, ILE ;-)
0
 

Expert Comment

by:Joshjje
ID: 8061522
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-
0
 
LVL 9

Expert Comment

by:ginsonic
ID: 8062486
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 :)
0
 

Author Comment

by:hutelihut
ID: 8091687
Which effect has TCustomForm.DefaultMonitor?
0
 

Expert Comment

by:Joshjje
ID: 8113974
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.
0
 

Author Comment

by:hutelihut
ID: 8189725
Thanks. Sorry for the late reply.
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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses
Course of the Month13 days, 19 hours left to enroll

801 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