随笔-200  评论-148  文章-15  trackbacks-0
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 无声 阅读(1516) 评论(0)  编辑  收藏 所属分类: 职场生活

只有注册用户登录后才能发表评论。


网站导航: