procedure SetFormMonitor(Form:TCustomForm;MonitorIndex:integer);
begin
if (MonitorIndex>-1) and (MonitorIndex<Screen.MonitorCount) then{保证屏幕索引在范围内}
begin
Form.SetBounds(
Screen.Monitors[MonitorIndex].Left + ((Screen.Monitors[MonitorIndex].Width - Form.Width) div 2),
Screen.Monitors[MonitorIndex].Top + ((Screen.Monitors[MonitorIndex].Height - Form.Height) div 2),
Form.Width,
Form.Height
);
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
if Screen.MonitorCount>1 then
setformMonitor(Form1,1);
{Form1.SetBounds(1700,200,600,300);}
{left:=1700;}
end;