Screen.GetBounds Method

Definition

Retrieves the bounds of the display.

Overloads

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.

GetBounds(Control)

Source:
Screen.cs
Source:
Screen.cs
Source:
Screen.cs

Retrieves the bounds of the display that contains the largest portion of the specified control.

C#
public static System.Drawing.Rectangle GetBounds(System.Windows.Forms.Control ctl);

Parameters

ctl
Control

The Control for which to retrieve the display bounds.

Returns

A Rectangle that specifies the bounds of the display that contains the specified control. In multiple display environments where no display contains the specified control, the display closest to the control is returned.

Applies to

.NET Framework 4.8.1 och andra versioner
Produkt Versioner
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

GetBounds(Point)

Source:
Screen.cs
Source:
Screen.cs
Source:
Screen.cs

Retrieves the bounds of the display that contains the specified point.

C#
public static System.Drawing.Rectangle GetBounds(System.Drawing.Point pt);

Parameters

pt
Point

A Point that specifies the coordinates for which to retrieve the display bounds.

Returns

A Rectangle that specifies the bounds of the display that contains the specified point. In multiple display environments where no display contains the specified point, the display closest to the point is returned.

Applies to

.NET Framework 4.8.1 och andra versioner
Produkt Versioner
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

GetBounds(Rectangle)

Source:
Screen.cs
Source:
Screen.cs
Source:
Screen.cs

Retrieves the bounds of the display that contains the largest portion of the specified rectangle.

C#
public static System.Drawing.Rectangle GetBounds(System.Drawing.Rectangle rect);

Parameters

rect
Rectangle

A Rectangle that specifies the area for which to retrieve the display bounds.

Returns

A Rectangle that specifies the bounds of the display that contains the specified rectangle. In multiple display environments where no monitor contains the specified rectangle, the monitor closest to the rectangle is returned.

Applies to

.NET Framework 4.8.1 och andra versioner
Produkt Versioner
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10