5 instantiations of Screen
System.Windows.Forms (5)
System\Windows\Forms\Screen.cs (5)
111
screens.Add(
new
(hmonitor, hdc));
173
return new
Screen
(s_primaryMonitor, default);
252
: new
Screen
(s_primaryMonitor);
260
: new
Screen
(s_primaryMonitor, default);
278
: new
Screen
(s_primaryMonitor, default);
104 references to Screen
Microsoft.VisualBasic.Tests (1)
Microsoft\VisualBasic\Devices\ComputerTests.cs (1)
36
Assert.Equal(System.Windows.Forms.
Screen
.PrimaryScreen, computer.Screen);
System.Windows.Forms (45)
System\Windows\Forms\ContextMenuStrip.cs (1)
98
Rectangle screenBounds =
Screen
.FromRectangle(bounds).Bounds;
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (2)
6427
Rectangle rectScreen =
Screen
.FromControl(this).WorkingArea;
18826
Rectangle rect =
Screen
.GetBounds(pt);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.cs (1)
1420
Rectangle rectScreen =
Screen
.FromControl(EditTextBox).WorkingArea;
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDown.cs (1)
552
return
Screen
.GetWorkingArea(Bounds).Size - Padding.Size;
System\Windows\Forms\Dialogs\CommonDialogs\CommonDialog.cs (1)
97
Rectangle screen =
Screen
.GetWorkingArea(Control.MousePosition);
System\Windows\Forms\Form.cs (9)
3657
Screen
desktop;
3664
desktop =
Screen
.FromHandle(ownerHandle.Handle);
3669
desktop =
Screen
.FromPoint(MousePosition);
3856
Screen
desktop =
Screen
.FromHandle(ownerHandle);
3897
Screen
desktop;
3900
desktop =
Screen
.FromControl(OwnerInternal);
3910
desktop = !hWndOwner.IsNull ?
Screen
.FromHandle(hWndOwner) :
Screen
.FromPoint(MousePosition);
System\Windows\Forms\Internal\WinFormsUtils.cs (2)
65
return ConstrainToBounds(
Screen
.GetWorkingArea(bounds), bounds);
73
return ConstrainToBounds(
Screen
.FromRectangle(bounds).Bounds, bounds);
System\Windows\Forms\Rendering\DisplayInformation.cs (2)
30
if (s_bitsPerPixel == 0 &&
Screen
.PrimaryScreen is not null)
37
s_bitsPerPixel = (short)
Screen
.PrimaryScreen.BitsPerPixel;
System\Windows\Forms\Screen.cs (14)
48
private static
Screen
[]? s_screens;
100
public static unsafe
Screen
[] AllScreens
108
List<
Screen
> screens = [];
154
public static
Screen
? PrimaryScreen
160
Screen
[] screens = AllScreens;
244
public override bool Equals(object? obj) => obj is
Screen
comp && _hmonitor == comp._hmonitor;
247
/// Retrieves a <see cref="
Screen
"/> for the monitor that contains the specified point.
249
public static
Screen
FromPoint(Point point)
255
/// Retrieves a <see cref="
Screen
"/> for the monitor that contains the largest region of the rectangle.
257
public static
Screen
FromRectangle(Rectangle rect)
263
/// Retrieves a <see cref="
Screen
"/> for the monitor that contains the largest region of the window of the control.
265
public static
Screen
FromControl(Control control)
273
/// Retrieves a <see cref="
Screen
"/> for the monitor that contains the largest region of the window.
275
public static
Screen
FromHandle(IntPtr hwnd)
System\Windows\Forms\ToolTip\ToolTip.cs (12)
1317
Screen
screen =
Screen
.FromPoint(cursorLocation);
1930
Screen
screen =
Screen
.FromPoint(moveToLocation);
2086
Screen
screen =
Screen
.FromPoint(Cursor.Position);
2182
Screen
screen =
Screen
.FromPoint(cursorPos);
2204
Screen
screen =
Screen
.FromPoint(tipInfo.Position);
2239
Screen
screen =
Screen
.FromPoint(Cursor.Position);
System.Windows.Forms.Design (7)
System\ComponentModel\Design\DesignerActionPanel.cs (1)
234
Rectangle rectScreen =
Screen
.FromPoint(rectangleAnchor.Location).WorkingArea;
System\ComponentModel\Design\DesignerActionPanel.EditorPropertyLine.cs (2)
347
Rectangle rectScreen =
Screen
.FromRectangle(ActionPanel.RectangleToScreen(editorBounds)).WorkingArea;
371
Rectangle rectScreen =
Screen
.FromRectangle(ActionPanel.RectangleToScreen(editorBounds)).WorkingArea;
System\ComponentModel\Design\MultilineStringEditor.MultilineStringEditorUI.cs (2)
163
Rectangle workingArea =
Screen
.GetWorkingArea(this);
239
Rectangle workingArea =
Screen
.GetWorkingArea(this);
System\Windows\Forms\Design\ToolStripDesignerUtils.cs (2)
539
foreach (
Screen
s in
Screen
.AllScreens)
System.Windows.Forms.Tests (47)
System\Windows\Forms\ScreenTests.cs (45)
14
Screen
[] screens =
Screen
.AllScreens;
16
Assert.Same(screens,
Screen
.AllScreens);
18
foreach (
Screen
screen in screens)
29
Screen
screen =
Screen
.PrimaryScreen;
36
Screen
screen = new((HMONITOR)(nint)1);
44
Screen
screen = new((HMONITOR)(nint)1);
52
public void Screen_Equals_Invoke_ReturnsExpected(
Screen
screen, object obj, bool expected)
59
public void Screen_GetHashCode_Invoke_ReturnsExpected(
Screen
screen1,
Screen
screen2, bool expected)
77
Screen
screen =
Screen
.FromControl(control);
85
Assert.Throws<ArgumentNullException>("control", () =>
Screen
.FromControl(null));
91
Screen
screen =
Screen
.FromHandle(IntPtr.Zero);
100
Screen
screen =
Screen
.FromHandle(control.Handle);
117
Screen
screen =
Screen
.FromPoint(point);
134
Screen
screen =
Screen
.FromRectangle(rectangle);
143
Screen
screen =
Screen
.FromControl(control);
144
Assert.Equal(screen.Bounds,
Screen
.GetBounds(control));
151
Screen
screen =
Screen
.FromPoint(point);
152
Assert.Equal(screen.Bounds,
Screen
.GetBounds(point));
159
Screen
screen =
Screen
.FromRectangle(rectangle);
160
Assert.Equal(screen.Bounds,
Screen
.GetBounds(rectangle));
166
Assert.Throws<ArgumentNullException>("control", () =>
Screen
.GetBounds(null));
173
Screen
screen =
Screen
.FromControl(control);
174
Assert.Equal(screen.WorkingArea,
Screen
.GetWorkingArea(control));
181
Screen
screen =
Screen
.FromPoint(point);
182
Assert.Equal(screen.WorkingArea,
Screen
.GetWorkingArea(point));
189
Screen
screen =
Screen
.FromRectangle(rectangle);
190
Assert.Equal(screen.WorkingArea,
Screen
.GetWorkingArea(rectangle));
196
Assert.Throws<ArgumentNullException>("control", () =>
Screen
.GetWorkingArea(null));
202
Screen
screen =
Screen
.PrimaryScreen;
206
private static void VerifyScreen(
Screen
screen)
System\Windows\Forms\SystemInformationTests.cs (1)
513
Assert.Equal(count,
Screen
.AllScreens.Length);
System\Windows\Forms\ToolStripDropDownTests.cs (1)
116
Assert.Equal(
Screen
.GetWorkingArea(new Rectangle(0, 0, 100, 25)).Size - new Size(2, 4), control.MaxItemSize);
System.Windows.Forms.UI.IntegrationTests (4)
FormTests.cs (2)
64
var screenWorkingArea =
Screen
.FromControl(form).WorkingArea;
124
var screenWorkingArea =
Screen
.FromControl(form).WorkingArea;
Infra\ScreenshotService.cs (1)
49
if (
Screen
.PrimaryScreen is not { } primaryScreen)
TabControlTests.cs (1)
57
TestOutputHelper.WriteLine($"Primary screen: {
Screen
.PrimaryScreen?.WorkingArea}");