Board index » cppbuilder » Application placement when user has multiple monitors / screens

Application placement when user has multiple monitors / screens


2007-09-07 05:24:05 AM
cppbuilder26
Could anyone provide some help on how to manage where an application will
open on a system that uses multiple monitors? Is there a way of ensuring
the application will open were the programmer what it to open i.e. centre of
say the primary screen and is there a way to target other screens if they
are present.
thanks
daryl
 
 

Re:Application placement when user has multiple monitors / screens

"Daryl" < XXXX@XXXXX.COM >wrote in message
Quote
Could anyone provide some help on how to manage where
an application will open on a system that uses multiple monitors?
Simply set the TForm's Left/Top properties to an area occupied by the
desired monitor before then displaying the TForm. You can use the global
TScreen object to know how many monitors are present and what their
coordinates are within the virtual desktop.
Gambit
 

Re:Application placement when user has multiple monitors / screens

Gambit wrote:
Quote
Simply set the TForm's Left/Top properties to an area occupied by the
desired monitor before then displaying the TForm. You can use the global
TScreen object to know how many monitors are present and what their
coordinates are within the virtual desktop.
Thanks for the response Gambit - Is there a better way than what I have
shown below? I am sure there is but this is the best I can conjure up. I
would be interested in your approach...
BTW - I have set the Position property in design view to poDesigned.
if(Screen->MonitorCount>1) {
// Set the main form's properties Top and Left to centre form on Primary
Screen
frmMain->Top = (Screen->PrimaryMonitor->Height - frmMain->Height) / 2;
frmMain->Left = (Screen->PrimaryMonitor->Width - frmMain->Width) / 2;
}
else {
frmMain->Position = poDesktopCenter;
}
 

{smallsort}

Re:Application placement when user has multiple monitors / screens

"Daryl" < XXXX@XXXXX.COM >wrote in message
Quote
Is there a better way than what I have shown below?
Try setting the Position property to poScreenCenter and the DefaultMonitor
property to dmPrimary.
Gambit