. Net support for multiple monitors

Source: Internet
Author: User
. Net support for multiple monitors

Posted on impermanence reading (1733) Comments (0) EDIT favorites category: dot net Nowadays, many video cards are equipped with S terminals and can be directly connected to TVs or projectors (of course, dual-head graphics cards or dual graphics cards can also be used ).
WINXP has built-in support for dual-display. After a dual-output video card is installed, two monitor icons are displayed in the display properties.
Select "extend window desktop to this monitor" on the second monitor to use the second monitor as an extension of the first monitor.
For example, if the resolution of the two monitors is 1280*1024, the two monitors will have a desktop of 2560*1024.
It is easy to use, as long as you drag the window to another monitor.
In this way, you can enable vs2005 on one monitor and enable msdn on another monitor, or write on one monitor.ProgramAnother monitor uses PPLIVE to watch the World Cup.

. Net2.0 in system. windows. forms. the screen class provides support for multiple monitors (see ms-help: // Ms. msdnqtr. v80.chs/MS. msdn. v80/MS. netdevfx. v20.chs/cpref17/html/t_system_windows_forms_screen.htm ).
Public attributes


  Name Description
Allscreens Returns an array of all displays on the system.
Bitsperpixel Obtains the memory bits associated with one pixel of the data.
Bounds Obtain the displayed boundary.
Devicename Obtain the name of the device associated with the display.
Primary Gets a value indicating whether a display is a master device.
Primaryscreen Obtain the primary display.
Workingarea Obtain the display workspace. The work area is the desktop area of the monitor, excluding the taskbar, dock window, and dock toolbar.

Top

Common Methods (See protected methods)
  Name Description
Equals Overloaded. Overwritten.
Fromcontrol Retrieve the display that contains the largest part of the specified control in screen.
Fromhandle Retrieves the screen of the display that contains the largest part of the object (referenced by the specified handle.
Frompoint Returns the screen of the monitor that contains the specified vertex.
Fromrectangle Returns the screen of the display that contains the largest part of the rectangle.
Getbounds Overloaded. Retrieves the display boundary.
Gethashcode Overwritten. Calculate and retrieve the object hashCode.
Obtain . (From Inheritance .)
Getworkingarea Overloaded. Retrieve the display workspace.
Determine the specified Whether the instance is the same. (From Inheritance .)
Tostring Overwritten. Returns the string representing the object.


With this class, it is easy to control the use of dual-monitor in the program. You only need to move the form to the coordinate range of the corresponding monitor.
For example, I use two 17-inch LCD, the resolution of the main monitor is 1280*1024, and the secondary monitor is placed on the right, the resolution is reduced by 1024*768 because the distance is too long.

To move the form to the secondary display, you only need one line of code:This. Publish toplocation=Screen. allscreens [1]. Bounds. location;

To enable full screen display on the secondary monitor:This. Formborderstyle=Formborderstyle. None;
This. Topics topbounds=Screen. allscreens [1]. Bounds;

In the system developed by the author, there is a subsystem that needs to perform operations on the main monitor after entering the system and play video in full screen on the secondary monitor.
The original solution was to use a commercial software, which could implement two sets of mouse and keyboard in WINXP. After two users log on, they work on two monitors separately without interfering with each other. After each restart, I used another user to log on to play the video. Later I thought it was too troublesome. I wrote a simple player after finding the information. After the system starts, the video is automatically played in full screen on the secondary monitor. Saving the trouble of logging on to two users at a time.
0 0

0

(Please Article Make comments)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.