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