• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 478
  • Last Modified:

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?
1
hutelihut
Asked:
hutelihut
  • 4
  • 2
  • 2
  • +2
1 Solution
 
ginsonicCommented:
Simple:

Form.Left:=Screen.Width+WhereYouWish;
0
 
hutelihutAuthor Commented:
Sorry, but that does'nt work
0
 
hutelihutAuthor Commented:
...The form is automaticly (somehow) put on the primary screen.
0
Industry Leaders: 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!

 
ILECommented:
just a second
solution is on the way
...
0
 
ILECommented:

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
 
Lukasz LachCommented:
lol, ILE ;-)
0
 
JoshjjeCommented:
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
 
ginsonicCommented:
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
 
hutelihutAuthor Commented:
Which effect has TCustomForm.DefaultMonitor?
0
 
JoshjjeCommented:
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
 
hutelihutAuthor Commented:
Thanks. Sorry for the late reply.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 2
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now