//poScreenCenter时,窗体会显示到主显示器的中央
MainForm.Position := poScreenCenter;

function TGAEAMainForm.GetWorkArea(var R : TRect) : Boolean;
var
I : Integer;
begin
Result := False;
for I := 0 to Screen.MonitorCount -1 do
if Screen.Monitors[I].Primary then
begin
R := Screen.Monitors[I].WorkareaRect;
Result := True;
Break;
end;
end;

procedure TGAEAMainForm.TempInitForm;
procedure SetFormMonitor(Form:TCustomForm;MonitorIndex:integer);
begin
if (MonitorIndex>-1) and (MonitorIndex<Screen.MonitorCount) then //保证屏幕索引在范围内
begin
Form.Left := 0;
Form.Top := 0;
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;
function GetPriMaryScreenIndex: Integer;
var
I : Integer;
begin
for I := 0 to Screen.MonitorCount -1 do
if Screen.Monitors[I].Primary then
begin
Result := I;
Break;
end;
end;
var
vR: TRect;
vPrimaryIndex: Integer;
begin
vPrimaryIndex := GetPriMaryScreenIndex;
if vPrimaryIndex <> -1 then
SetFormMonitor(MainForm, vPrimaryIndex);
// if GetWorkArea(vR) then
// begin
// MainForm.Left := vR.Left;
// MainForm.Top := vR.Top;
// end;
end;

delphi 设置多屏幕的更多相关文章

  1. delphi 在桌面屏幕上模拟鼠标单击

    delphi 在桌面屏幕上模拟鼠标单击 procedure TFrmUnicom.Button1Click(Sender: TObject); var oldPoint, newPoint: TPoi ...

  2. iOS 设置系统屏幕亮度

    // 设置系统屏幕亮度    //    [UIScreen mainScreen].brightness = value;    // 或者    [[UIScreen mainScreen] se ...

  3. delphi 窗体自适应屏幕分辨率

    delphi 窗体自适应屏幕分辨率 这是个困惑我很长时间的问题,到今天终于得到解决了. 话说Delphi有个很强的窗体设计器,这一点让VC粉丝垂涎三尺而不可得.但是,Delphi里设计的窗体并没有自动 ...

  4. android 设置系统屏幕亮度

    /** * 获得当前屏幕亮度的模式 * SCREEN_BRIGHTNESS_MODE_AUTOMATIC=1 为自动调节屏幕亮度 * SCREEN_BRIGHTNESS_MODE_MANUAL=0 为 ...

  5. 【转载】51CTO-Android设置模拟器屏幕大小

    在Eclipse Android中设置模拟器屏幕大小是本文要介绍的内容,主要是来了解并学习Eclipse Android中模拟器的设置,具体关于Eclipse Android内容的详解来看本文.   ...

  6. 用delphi写多屏幕程序

    http://blog.csdn.net/zyyjc/article/details/6530728 别现在有些POS机是双屏幕的(比如卡西瓦POS机),一个屏幕可以当顾客显示屏用,当闲时也可以显示一 ...

  7. 在Eclipse Android中设置模拟器屏幕大小

    在Eclipse Android中设置模拟器屏幕大小是本文要介绍的内容,主要是来了解并学习Eclipse Android中模拟器的设置,具体关于Eclipse Android内容的详解来看本文. 方法 ...

  8. DELPHI设置枚举类型size

    delphi枚举类型长度默认为2个字节(单字),而在C中枚举为4个字节(双字),如果需要跨这两个平台编程,传输结构时会由于数据长度不一造成灾难. 经过查找资料,原来delphi可以通过{$Z+} {$ ...

  9. Android Toast 设置到屏幕中间,自定义Toast的实现方法,及其说明

    http://blog.csdn.net/wangfayinn/article/details/8065763 Android Toast用于在手机屏幕上向用户显示一条信息,一段时间后信息会自动消失. ...

随机推荐

  1. C语言关于进制转换,补码, 整数的位操作

    菜单导航: 1.二进制.八进制.十进制.十六进制的相互转换 2.原码.反码.补码 3.举例证明整数在计算机内是以补码的形式存在(以负数为例) 4.整数的位操作:按位且&.或|.异或^.取反~ ...

  2. Android 开发随笔

    1 获取屏幕尺寸 WindowManager wm = this.getWindowManager();viewWidth = wm.getDefaultDisplay().getWidth();vi ...

  3. Python_冒泡排序

    从小到大的排序:(最前面的数和一步步和后面的数比较,如果大于则交换,如果不大于则继续循环) 方法1: data = [65, 1, 45, 77, 3, 9, 43, 23, 7, 53, 213, ...

  4. BZOJ1066 [SCOI2007]蜥蜴 网络流 最大流 SAP

    由于本题和HDU2732几乎相同,所以读者可以看-> HDU2732题解传送门: http://www.cnblogs.com/zhouzhendong/p/8362002.html

  5. springmvc基础使用配置

    前言 本案例是在idea编辑器下,maven管理项目的前提下. 步骤 1.新建maven项目 2.配置web.xml <?xml version="1.0" encoding ...

  6. tensorflow基础架构 - 处理结构+创建一个线性回归模型+session+Variable+Placeholder

    以下仅为自己的整理记录,绝大部分参考来源:莫烦Python,建议去看原博客 一.处理结构 因为TensorFlow是采用数据流图(data flow graphs)来计算, 所以首先我们得创建一个数据 ...

  7. 应用:计算字符串的长度(一个双字节字符长度计2,ASCII字符计1) String.prototype.len=function(){return this.replace(/[^\x00-\xff]/g,"aa").length;}

    应用:计算字符串的长度(一个双字节字符长度计2,ASCII字符计1) String.prototype.len=function(){return this.replace(/[^\x00-\xff] ...

  8. supervisor 监控redis & mongodb

    安装 安装python brew install python 安装pipwget https://bootstrap.pypa.io/get-pip.pysudo python get-pip.py ...

  9. 网络编程-线程-3、通过继承Thread类创建线程

    知识点:之前第一节介绍创建线程的方法是:通过threading.Thread(target=函数名不要加括号)创建一个对象,通过对象调用start方法创建并启动线程:                  ...

  10. Linux 中 Windows 中文乱码

    Linux 下 Windows 源代码中文乱码 由于 windows 和 linux 对文本的编码方式不同,所以经常会有 windows 中生成的文本在 linux 中打开乱码的情况. 比如: 我面临 ...