Screen Class
Represents a display device or multiple display devices on a single system.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
| Name | Description | |
|---|---|---|
![]() ![]() | AllScreens | Gets an array of all displays on the system. |
![]() | BitsPerPixel | Gets the number of bits of memory, associated with one pixel of data. |
![]() | Bounds | Gets the bounds of the display. |
![]() | DeviceName | Gets the device name associated with a display. |
![]() | Primary | Gets a value indicating whether a particular display is the primary device. |
![]() ![]() | PrimaryScreen | Gets the primary display. |
![]() | WorkingArea | Gets the working area of the display. The working area is the desktop area of the display, excluding taskbars, docked windows, and docked tool bars. |
| Name | Description | |
|---|---|---|
![]() | Equals(Object^) | Gets or sets a value indicating whether the specified object is equal to this Screen.(Overrides Object::Equals(Object^).) |
![]() | Finalize() | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.) |
![]() ![]() | FromControl(Control^) | Retrieves a Screen for the display that contains the largest portion of the specified control. |
![]() ![]() | FromHandle(IntPtr) | Retrieves a Screen for the display that contains the largest portion of the object referred to by the specified handle. |
![]() ![]() | FromPoint(Point) | Retrieves a Screen for the display that contains the specified point. |
![]() ![]() | FromRectangle(Rectangle) | Retrieves a Screen for the display that contains the largest portion of the rectangle. |
![]() ![]() | GetBounds(Control^) | Retrieves the bounds of the display that contains the largest portion of the specified control. |
![]() ![]() | GetBounds(Point) | Retrieves the bounds of the display that contains the specified point. |
![]() ![]() | GetBounds(Rectangle) | Retrieves the bounds of the display that contains the largest portion of the specified rectangle. |
![]() | GetHashCode() | Computes and retrieves a hash code for an object.(Overrides Object::GetHashCode().) |
![]() | GetType() | |
![]() ![]() | GetWorkingArea(Control^) | Retrieves the working area for the display that contains the largest region of the specified control. The working area is the desktop area of the display, excluding taskbars, docked windows, and docked tool bars. |
![]() ![]() | GetWorkingArea(Point) | Retrieves the working area closest to the specified point. The working area is the desktop area of the display, excluding taskbars, docked windows, and docked tool bars. |
![]() ![]() | GetWorkingArea(Rectangle) | Retrieves the working area for the display that contains the largest portion of the specified rectangle. The working area is the desktop area of the display, excluding taskbars, docked windows, and docked tool bars. |
![]() | MemberwiseClone() | |
![]() | ToString() | Retrieves a string representing this object.(Overrides Object::ToString().) |
The constructor for this object is not public, so you cannot explicitly create a Screen object. The object is created when you call its public methods.
The following code example shows how to use various methods and properties of the Screen class. The example calls the AllScreens property to retrieve an array of all the screens connected to the system. For each returned Screen, the example adds the device name, bounds, type, working area, and primary screen to a ListBox. To use the example, add a ListBox and a Button to a form, and then add a Click event handler for the button.
private: void button1_Click( Object^ /*sender*/, System::EventArgs^ /*e*/ ) { // For each screen, add the screen properties to a list box. for each (Screen^ screen in Screen::AllScreens) { listBox1->Items->Add( String::Concat("Device Name: ", screen->DeviceName)); listBox1->Items->Add( String::Concat("Bounds: ", screen->Bounds)); listBox1->Items->Add( String::Concat("Type: ", screen->GetType())); listBox1->Items->Add( String::Concat("Working Area: ", screen->WorkingArea)); listBox1->Items->Add( String::Concat("Primary Screen: ", screen->Primary)); } }
Available since 1.1
Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.



