A split-screen display allows multiple programs running within a host to be displayed on different two (or more) screens, respectively. Currently on the market mainstream graphics card support split screen display (display dual screen), if you need to display more than 2 screens, you should use the "drag card" class of hardware.
There are two ways to set up a split screen display:
1, with two video cards to connect two monitors, enter the system, to distinguish which is the main video card, the desktop blank right click, point properties, and then in the window, click on the "Settings" tab, you will see two displays, 1 (main graphics card) and 2 (secondary video card), click that 2, in the following " Expand the Windows desktop to the Monitor "tick, OK, you try to move the mouse toward the right edge of the main display, then move, the mouse will run to the second monitor up, so that the same run several programs, respectively, their windows dragged into the area of two monitors can be, This actually extends the desktop a bit.
2, the use of specialized hardware. You can use the "one drag more" drag machine card, as long as the device plugged into the USB port, the device leads to the two PS/2 port, respectively, the mouse and keyboard, the host or two video card, and then installed the special software of this device, after restarting, after a simple configuration, you can achieve "completely" independent of the two systems.
The so-called split-screen or multi-screen software, is the software in a number of forms, run on the main screen, but the various forms (coordinates) moved to the respective extension screen location as shown:
Home screen (MainForm) Index=0 |
Extended Screen 1 (FORM1) Index=1 |
Extended Screen 2 (FORM2) Index= ... |
Extended Screen 3 (FORM3) Index= ... |
The following is the most commonly used two-screen display, that is, left and right mode screen display method.
WinForm the implementation of the method:
With the screen class in WinForm, you can easily implement multiple forms to display on multiple screens, respectively.
- 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));
- Make the form appear on the 2nd screen:
This. left = ((Screen.allscreens[1]. Bounds.width-this. Width)/2);
This. Top = ((Screen.allscreens[1]. Bounds.height-this. Height)/2); Ways to display any form on any screen:
[CSharp]View Plaincopy
- Call this method in the OnLoad event of the form
- protected void form1_onload (...) {
- Showonmonitor (1); //index=1
- }
- Private void showonmonitor (int showonmonitor)
- {
- Screen[] SC;
- sc = screen.allscreens;
- if (Showonmonitor >= SC. Length) {
- Showonmonitor = 0;
- }
- This . StartPosition = formstartposition.manual;
- This . Location = new Point (Sc[showonmonitor]. Bounds.left, Sc[showonmonitor]. Bounds.top);
- //If you intend the form to being maximized, change it to normal then maximized.
- This . WindowState = Formwindowstate.normal;
- This . WindowState = formwindowstate.maximized;
- }
For WPF forms, as long as simple changes can be made: the first thing to add a reference to System.Windows.Forms and System.Drawing is the following simple reference code:
[CSharp]View Plaincopy
- protected override void onstartup (StartupEventArgs e)
- {
- base. Onstartup (e);
- Window1 W1 = new Window1 ();
- Window2 W2 = new Window2 ();
- Screen S1 = screen.allscreens[0];
- Screen s2 = screen.allscreens[1];
- Rectangle r1 = S1. Workingarea;
- Rectangle r2 = s2. Workingarea;
- W1. Top = R1. Top;
- W1. left = R1. Left;
- W2. Top = R2. Top;
- W2. left = R2. Left;
- W1. Show ();
- W2. Show ();
- W2. Owner = W1;
- }
Note: Must be in the form before loading, to determine whether the screen to be displayed or not, otherwise it will be an error! Transferred from: http://www.cnblogs.com/lizi/archive/2012/02/21/2361229.html
C # Winform developing a split-screen display application