The use of multi-screen reality--screen class in C #

Source: Internet
Author: User

Screen class

represents one or more display devices on a single system

namespaces: System.Windows.Forms

Assembly: System.Windows.Forms (in System.Windows.Forms.dll)

syntax: public class screen

The constructor for this object is not public, so the Create screen object cannot be displayed, which is created when a public method is called.

Screen.allscreens Properties:

gets an array of all the monitors on the system.

syntax: public static screen[] Allscreens{get;}

Screen.workingarea Properties:

gets the work area of the monitor. The workspace is the desktop area of the display, excluding the taskbar, docking window, and docking toolbar.

syntax: public Rectangle workingarea{get;}

For example: Myscreen is a window that declares an object of a window My_screen

Myscreen My_screen;

System.Windows.Forms.Screen s2 = system.windows.forms.screen.allscreens[0];

System.Drawing.Rectangle r2 = s2. Workingarea;

My_screen. Top = R2. Top;

My_screen. left = R2. Left;

My_screen. Width = R2. Width;

My_screen. Height = R2. Height;

My_screen. Show ();

My_screen. WindowState = System.Windows.WindowState.Maximized;

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

The use of multi-screen reality--screen class in C #

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.