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