This article mainly introduced the WinForm window realizes the multi-display display 2 kinds of methods, this article has given the realization code directly, and has made the explanation to some important parameters, needs the friend to be possible the reference.
A host is connected to 2 displays (2 video cards), requiring two forms of a program to be displayed on different monitors: Display 1 shows From1, and monitor 2 shows From2. The code and description are as follows:
Form1 do not need to change the code, FROM2 add the following code:
Method One: From2 frm2 = new From2 (); if (Screen.AllScreens.Count ()! = 1) { frm2. left = Screen.allscreens[0]. Bounds.width; Frm2. Top = 0; Frm2. Size = new System.Drawing.Size (screen.allscreens[1]. Bounds.width, Screen.allscreens[1]. Bounds.height);} Method Two: This . left = ((Screen.allscreens[1]. Bounds.width-this. Width)/2); This. Top = ((Screen.allscreens[1]. Bounds.height-this. Height)/2); This. Size = new System.Drawing.Size (screen.allscreens[1]. Bounds.width, Screen.allscreens[1]. Bounds.height);
Description
Gets the number of screens currently connected to the system: Screen.AllScreens.Count ();
Gets the name of the current screen: string currentscreenname = Screen.fromcontrol (this). devicename;
Gets the current screen object: Currentscreen = Screen.fromcontrol (this);
Gets the screen where the current mouse is located: Currentscreen = Screen.frompoint (new Point (cursor.position.x, CURSOR.POSITION.Y));
Source: http://www.jb51.net/article/67263.htm
2 ways to realize multi-display and multi-screen display in WinForm program