双屏显示1

// 利用WinForm中的Screen类,即可比较方便地实现多窗体分别在多个屏幕上显示。
//•获取当前系统连接的屏幕数量: Screen.AllScreens.Count();
//•获取当前屏幕的名称:string CurrentScreenName = Screen.FromControl(this).DeviceName;
//•获取当前屏幕对象:Screen CurrentScreen = Screen.FromControl(this);
//•获取当前鼠标所在的屏幕:Screen CurrentScreen = Screen.FromPoint(new Point(Cursor.Position.X, Cursor.Position.Y));
//•让窗体在第2个屏幕上显示:
//this.Left = ((Screen.AllScreens[1].Bounds.Width - this.Width) / 2);
//this.Top = ((Screen.AllScreens[1].Bounds.Height - this.Height) / 2);
private void showOnMonitor(int showOnMonitor)
{
Screen[] sc;
sc = Screen.AllScreens;
if (showOnMonitor >= sc.Length)
{
showOnMonitor = ;
}
this.FormBorderStyle = FormBorderStyle.None; //无边框全屏显示
this.StartPosition = FormStartPosition.Manual;
this.Location = new Point(sc[showOnMonitor].Bounds.Left, sc[showOnMonitor].Bounds.Top);
//this.Location = new Point(((sc[showOnMonitor].Bounds.Width-this.Width)/2), ((sc[showOnMonitor].Bounds.Height-this.Height)/2));
// If you intend the form to be maximized, change it to normal then maximized.
//this.WindowState = FormWindowState.Normal;
this.WindowState = FormWindowState.Maximized;//最大化窗口 } 如果接双显卡时showOnMonitor 参数等于0为主屏,1为扩展屏

双屏显示1

双屏显示2
private void showOnMonitor2()
{
Screen[] sc;
sc = Screen.AllScreens;
//get all the screen width and heights
Form1 f = new Form1();
f.FormBorderStyle = FormBorderStyle.None;
f.Left = sc[].Bounds.Width;
f.Top = sc[].Bounds.Height;
f.StartPosition = FormStartPosition.Manual;
f.Location = sc[].Bounds.Location;
Point p = new Point(sc[].Bounds.Location.X, sc[].Bounds.Location.Y);
f.Location = p;
f.WindowState = FormWindowState.Maximized;
f.Show();
} 接入双显卡时sc[]为主屏、sc[]扩展屏

双屏显示2

一个窗体双屏显示

  this.Location = new Point(,);
Screen[] sc;
sc = Screen.AllScreens;
this.Width = (sc[].Bounds.Width + sc[].Bounds.Width);//+20;
this.Height = (sc[].Bounds.Height); //+200;
this.FormBorderStyle = FormBorderStyle.None; //边框样式
webBrowser1.Width = sc[].Bounds.Width;
webBrowser1.Height = sc[].Bounds.Height;
webBrowser1.Location = new Point(sc[].Bounds.Location.X, sc[].Bounds.Location.Y);
webBrowser1.Url = new Uri("http://www.google.com.hk"); webBrowser2.Width = sc[].Bounds.Width;
webBrowser2.Height = sc[].Bounds.Height;
webBrowser2.Location = new Point(sc[].Bounds.Location.X, sc[].Bounds.Location.Y);
webBrowser2.Url = new Uri("http://www.baidu.com");

一个窗体双屏显示

此处为了知识记录用,出处:http://www.cnblogs.com/zzcong/archive/2012/06/13/2547877.html

C# Winform 双屏显示的更多相关文章

  1. Altium Designer完美双屏显示方法演示

    布线时我们往往需要对一些信号线做特别的走线处理,这样需要边布线边对照原理图,在protel99中那是一个很痛苦的事,在Altium Designer中这种情况将变很简单. 硬件要求,笔记本+外接显示器 ...

  2. win10笔记本实现双屏显示的自如切换

    前言 使用电脑的过程中想一边看内容,一边进行编辑,这就涉及到双屏显示并实现扩展分屏,本文就介绍一下这些操作. 工具 win10-thinkpad-E470:另一块显示屏(博主的是戴尔的显示器):一条外 ...

  3. 【转】WinForm窗体显示和窗体间传值

    以前对WinForm窗体显示和窗体间传值了解不是很清楚 最近做了一些WinForm项目,把用到的相关知识整理如下 A.WinForm中窗体显示 显示窗体可以有以下2种方法: Form.ShowDial ...

  4. Sublime Text 如何一个代码双屏显示代码上下部分?

    Sublime Text 如何一个代码双屏显示代码上下部分? sublime text如何一个代码双屏显示代码上下部分 先显示2行实图 把想要分屏显示的文件,打开新窗口,然后再拖过去就可以了. 快捷操 ...

  5. 【linux基础】ubuntu实现双屏显示

    前言 之前博主没有使用NVIDIA时候已经可以实现双屏显示(拼接类型),但是,安装NVIDIA驱动使用CUDA之后这个功能就消失了,需要重新配置. 实现方式 1. 使用Intel集成显卡时实现双屏拼接 ...

  6. [ubuntu]如何实现双屏显示

    一.首先直接运行xrandr命令,查看设备的相关信息: 运行之后会显示当前连接设备的屏幕信息,如下图 PS:我已经用HDMI线连接了外接显示器和主机 wangju@wangju-HP--G4:~$ x ...

  7. WinForm上显示gif动画:转

    WinForm上的ProgressBar,老实说,实在是不敢恭维,太死板,太难看了,即使做成实时显示处理进度的,它还是逃离不了“难看”.现 在的web2.0上到处都能看到一个显示正在处理的小圆圈在那转 ...

  8. 开发效率必备之Mac双屏显示

    自从2015年9月苹果公布EI Captain,带来了一个新的功能,叫做分屏,也就是在一块屏幕上分成左右两部分,能够分别进行操作,互不影响. 例如以下图所看到的: watermark/2/text/a ...

  9. C#WinForm程序显示控制台窗口Console

    启动一个WINFORM项目,使用一些API函数将控制台显示出来: AllocConsole 和 FreeConsole. 本程序只在DEBUG模式下显示控制台 [DllImport("ker ...

随机推荐

  1. Tomcat8 配置NIO

    conf/server.xml 打开:<Executor name="tomcatThreadPool" namePrefix="catalina-exec-&qu ...

  2. Please check if the Publishing Tools on the server (System/PublishingTools) are started.

    ArcMap或ArcCatalog中双击连接到Server即可,该工具即自动可启动

  3. Sublime Text 2/3如何支持中文GBK编码

    Sublime Text默认是只支持UTF8的编码,所以有些时候,当我们打开GBK文件时候,文件内会出先部分的乱码, 在菜单栏选择"Preferences"-->" ...

  4. PDO 提供了三种不同的错误处理模式

    PDO::ERRMODE_SILENT 此为默认模式. PDO 将只简单地设置错误码,可使用 PDO::errorCode() 和 PDO::errorInfo() 方法来检查语句和数据库对象.如果错 ...

  5. 如何仿写thinkphp的C方法?

    config.php代码如下: <?php return array( 'db_user'=>'root', 'db_pass'=>'root', 'db_name'=>'te ...

  6. 窗口对象的方法 prompt() 用来输入数据

    prompt()    窗口对象的方法,用来输入信息的 一.window.prompt('提示信息',默认值); 1.例: window.prompt('请输入文字','这是默认值'); var us ...

  7. javascript弹出框打印某个数值时,弹出NaN?(not a number)

    一.NaN:表示not a number null 未定义或空字符串 undefined 对象属性不存在 或是声明了变量但从未赋值. 二.出现这种情况有(1)此常数的值是零被零除所得到的结果. (2) ...

  8. SQL Server里的 ISNULL 与 NULLIF

    SQL Server 中有两个參数,语法:     ISNULL(check_expression, replacement_value) check_expression 与 replacement ...

  9. DataFromFile

    #region Copyright 2013, Andreas Hoffmann // project location ==> http://datafromfile.codeplex.com ...

  10. 熟练掌握HDFS的Java API接口访问

    HDFS设计的主要目的是对海量数据进行存储,也就是说在其上能够存储很大量文件(可以存储TB级的文件).HDFS将这些文件分割之后,存储在不同的DataNode上, HDFS 提供了两种访问接口:She ...