TScreen和TMonitor.
這兩者的區別在于TScreen代表的是一個虛擬的桌面,它可以擁有N個Monitor
,也就是物理的顯示器.
這是大富翁上抄下來的代碼
:-)
//將一個窗體顯示到指定的顯示器上
procedure SetWindowToMonitor(Form: TCustomForm;
//你想操作的窗體
MonitorIndex, //你想要顯示窗體的顯示
// 器索引, 0為主顯示
// 器,1為第二顯示器
Left, Top: Integer //窗體在顯示器上的位置
);
begin
if not Assigned(Form) then Exit;
if MonitorIndex >=
Screen.MonitorCount then Exit;
with Screen do
begin
Inc(Left,
Monitors[MonitorIndex].Left);
Inc(Top, Monitors[MonitorIndex].Top);
end;
Form.SetBounds(Left, Top, Form.Width, Form.Height);
end;
posted on 2010-08-06 10:23
無聲 閱讀(1576)
評論(0) 編輯 收藏 所屬分類:
職場生活