Home > Back-end >  Of the problem of screen display
Of the problem of screen display

Time:09-19

Main form in the display 1, click show a form in the 2 displays, how to do,

SetBounds will make two forms at the same time appear in a display,

CodePudding user response:

Demon elder brother answered this question, I just ctrl-c,

 void __fastcall CrnShowFormOnMonitor (TForm * form, int monitorIndex) 
{
If (Screen - & gt; MonitorCount & gt; MonitorIndex)
{
Form - & gt; DefaultMonitor=dmDesktop;
Form - & gt; Left=Screen - & gt; Monitors [monitorIndex] - & gt; The Left;
Form - & gt; Top=Screen - & gt; Monitors [monitorIndex] - & gt; Top;
}

Form - & gt; Show ();
}

Void __fastcall TForm1: : Button1Click (TObject * Sender)
{
Form2=new TForm2 (this);
//will Form2 displayed in the second display
CrnShowFormOnMonitor (Form2, 1);
}
According to the need to adjust Left/Top
  • Related