48 instantiations of Cursor
System.Windows.Forms (14)
System\Windows\Forms\Input\CursorConverter.cs (1)
70return new Cursor(ms);
System\Windows\Forms\Input\Cursors.cs (13)
55public static Cursor HSplit => s_hSplit ??= new("hsplit.cur", nameof(HSplit)); 56public static Cursor VSplit => s_vSplit ??= new("vsplit.cur", nameof(VSplit)); 57public static Cursor NoMove2D => s_noMove2D ??= new("nomove2d.cur", nameof(NoMove2D)); 58public static Cursor NoMoveHoriz => s_noMoveHoriz ??= new("nomoveh.cur", nameof(NoMoveHoriz)); 59public static Cursor NoMoveVert => s_noMoveVert ??= new("nomovev.cur", nameof(NoMoveVert)); 60public static Cursor PanEast => s_panEast ??= new("east.cur", nameof(PanEast)); 61public static Cursor PanNE => s_panNE ??= new("ne.cur", nameof(PanNE)); 62public static Cursor PanNorth => s_panNorth ??= new("north.cur", nameof(PanNorth)); 63public static Cursor PanNW => s_panNW ??= new("nw.cur", nameof(PanNW)); 64public static Cursor PanSE => s_panSE ??= new("se.cur", nameof(PanSE)); 65public static Cursor PanSouth => s_panSouth ??= new("south.cur", nameof(PanSouth)); 66public static Cursor PanSW => s_panSW ??= new("sw.cur", nameof(PanSW)); 67public static Cursor PanWest => s_panWest ??= new("west.cur", nameof(PanWest));
System.Windows.Forms.Tests (32)
System\Windows\Forms\AxHostTests.cs (1)
1583using Cursor original = new("bitmaps/cursor.cur");
System\Windows\Forms\CursorConverterTests.cs (5)
106Assert.Throws<NotSupportedException>(() => converter.ConvertTo(new Cursor(Cursors.AppStarting.Handle), typeof(InstanceDescriptor))); 129using Cursor sourceCursor = new(stream); 139using Cursor sourceCursor = new(fileName); 148Assert.Throws<InvalidOperationException>(() => converter.ConvertTo(new Cursor(Cursors.AppStarting.Handle), typeof(byte[]))); 238string converted = (string)converter.ConvertTo(new Cursor(Cursors.Default.Handle), typeof(string));
System\Windows\Forms\CursorTests.cs (25)
33using Cursor cursor = new(sourceCursor.Handle); 53Assert.Throws<ArgumentException>("handle", () => new Cursor(IntPtr.Zero)); 67using Cursor cursor = new(stream); 79using Cursor cursor = new(stream); 86Assert.Throws<ArgumentException>("stream", () => new Cursor(new MemoryStream())); 92Assert.Throws<ArgumentNullException>("stream", () => new Cursor((Stream)null)); 111Assert.Throws<ArgumentException>("stream", () => new Cursor(stream)); 118using Cursor cursor = new(fileName); 128Assert.Throws<ArgumentNullException>("path", () => new Cursor((string)null)); 136Assert.Throws<ArgumentException>("path", () => new Cursor(fileName)); 142Assert.Throws<FileNotFoundException>(() => new Cursor("NoSuchFile")); 149Assert.Throws<ArgumentException>("fileName", () => new Cursor(fileName)); 155using Cursor cursor = new(typeof(PropertyTabTests), "CustomPropertyTab"); 165Assert.Throws<ArgumentNullException>("type", () => new Cursor((Type)null, "resource")); 174Assert.Throws<ArgumentNullException>("stream", () => new Cursor(type, resource)); 246Cursor value = new(Cursors.AppStarting.Handle); 327using Cursor sourceCursor = new(Path.Combine("bitmaps", "10x16_one_entry_32bit.ico")); 332using Cursor cursor = new(sourceCursor.Handle); 342Cursor cursor = new(Path.Combine("bitmaps", "10x16_one_entry_32bit.ico")); 378using Cursor cursor = new(Path.Combine("bitmaps", "10x16_one_entry_32bit.ico")); 415using Cursor cursor = new(Path.Combine("bitmaps", "10x16_one_entry_32bit.ico")); 450Cursor cursor = new(Cursors.AppStarting.Handle); 452yield return new object[] { cursor, new Cursor(Cursors.AppStarting.Handle), true }; 453yield return new object[] { cursor, new Cursor(Cursors.Arrow.Handle), false }; 500using Cursor cursor = new(Path.Combine("bitmaps", "10x16_one_entry_32bit.ico"));
System\Windows\Forms\EmbeddedResourceTests.cs (1)
236using Cursor cursor = new(stream);
System.Windows.Forms.UI.IntegrationTests (2)
DragDropTests.cs (2)
751_myNormalCursor = new Cursor("./Resources/3dwarro.cur"); 752_myNoDropCursor = new Cursor("./Resources/3dwno.cur");
517 references to Cursor
System.Windows.Forms (149)
System\Windows\Forms\ActiveX\AxHost.cs (2)
310public override Cursor Cursor 3537protected static object? GetIPictureFromCursor(Cursor? cursor)
System\Windows\Forms\AmbientProperties.cs (1)
23public Cursor? Cursor { get; set; }
System\Windows\Forms\Control.cs (9)
1460public virtual Cursor Cursor 1469if (Properties.TryGetValue(s_cursorProperty, out Cursor? cursor)) 1475Cursor localDefault = DefaultCursor; 1482Cursor? localCursor = Properties.GetValueOrDefault<Cursor>(s_cursorProperty); 1483Cursor resolvedCursor = Cursor; 1554protected virtual Cursor DefaultCursor => Cursors.Default; 2952Cursor? oldCursor = null; 11875Cursor.Current = Cursor;
System\Windows\Forms\Controls\ComboBox\ComboBox.cs (1)
1753Cursor.Current = Cursor;
System\Windows\Forms\Controls\DataGridView\DataGridView.cs (3)
255private Cursor? _oldCursor; 1856internal Cursor CursorInternal 4078public Cursor? UserSetCursor => _dataGridViewState1[State1_CustomCursorSet]
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (2)
3383Cursor.Clip = RectangleToScreen(cursorClip); 25604Cursor.Clip = Rectangle.Empty;
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxEditingControl.cs (1)
67public virtual Cursor EditingPanelCursor => Cursors.Default;
System\Windows\Forms\Controls\DataGridView\DataGridViewLinkCell.cs (1)
37private static Cursor? s_dataGridViewCursor;
System\Windows\Forms\Controls\DataGridView\DataGridViewTextBoxEditingControl.cs (1)
78public virtual Cursor EditingPanelCursor
System\Windows\Forms\Controls\DataGridView\IDataGridViewEditingControl.cs (1)
33Cursor EditingPanelCursor
System\Windows\Forms\Controls\Labels\LinkLabel.cs (3)
44private Cursor? _overrideCursor; 284protected Cursor? OverrideCursor 1752Cursor.Current = OverrideCursor ?? Cursor;
System\Windows\Forms\Controls\ListView\ListView.cs (6)
4374Point pos = Cursor.Position; 5825pt = PointToClient(Cursor.Position) 5867pt = PointToClient(Cursor.Position) 5973AnnounceColumnHeader(Cursor.Position); 6328pt = PointToClient(Cursor.Position) 6650Point pos = Cursor.Position;
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.SnappableControl.cs (1)
25public override Cursor Cursor
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyDescriptorGridEntry.cs (4)
721Cursor? oldCursor = Cursor.Current; 724Cursor.Current = Cursors.WaitCursor; 769Cursor.Current = oldCursor;
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.cs (2)
3407Cursor? oldCursor = Cursor; 5249Point mouseLoc = Cursor.Position;
System\Windows\Forms\Controls\RichTextBox\RichTextBox.cs (1)
3468Cursor.Current = Cursors.Hand;
System\Windows\Forms\Controls\Splitter\Splitter.cs (1)
101protected override Cursor DefaultCursor => Dock switch
System\Windows\Forms\Controls\TextBox\TextBoxBase.cs (1)
470protected override Cursor DefaultCursor
System\Windows\Forms\Controls\ToolStrips\ToolStrip.cs (3)
484public override Cursor Cursor 4505if (_currentlyActiveTooltipItem is not null && !GetToolStripState(STATE_DRAGGING) && Cursor.Current is { } currentCursor) 4507Point cursorLocation = Cursor.Position;
System\Windows\Forms\Controls\ToolStrips\ToolStripContainer.cs (1)
215public override Cursor Cursor
System\Windows\Forms\Controls\ToolStrips\ToolStripGrip.cs (1)
11private Cursor? _oldCursor;
System\Windows\Forms\Controls\ToolStrips\ToolStripLabel.cs (1)
25private Cursor? _lastCursor;
System\Windows\Forms\Controls\ToolStrips\ToolStripPanel.cs (3)
959cursorLoc.Y = Cursor.Position.Y; 964cursorLoc.X = Cursor.Position.X; 967Cursor.Position = cursorLoc;
System\Windows\Forms\Controls\TreeView\TreeView.cs (4)
2062pt = PointToClient(Cursor.Position) 2923pt = PointToClient(Cursor.Position) 2954pt = PointToClient(Cursor.Position) 3028Point pos = PointToClient(Cursor.Position);
System\Windows\Forms\Controls\WebBrowser\WebBrowserBase.cs (1)
1322public override Cursor Cursor
System\Windows\Forms\Form.cs (1)
4359Cursor.Position = pointToSnap;
System\Windows\Forms\Input\Cursor.cs (21)
46: this(typeof(Cursors).Assembly.GetManifestResourceStream(typeof(Cursor), resource).OrThrowIfNull()) 54/// Initializes a new instance of the <see cref="Cursor"/> class from the specified <paramref name="handle"/>. 61throw new ArgumentException(string.Format(SR.InvalidGDIHandle, (typeof(Cursor)).Name), nameof(handle)); 69/// Initializes a new instance of the <see cref="Cursor"/> class with the specified <paramref name="fileName"/>. 81/// Initializes a new instance of the <see cref="Cursor"/> class from the specified <paramref name="resource"/>. 89/// Initializes a new instance of the <see cref="Cursor"/> class from the 116/// rectangle for this <see cref="Cursor"/> in screen coordinates. 140/// Gets or sets a <see cref="Cursor"/> that represents the current mouse cursor. 143public static Cursor? Current 154/// Gets the Win32 handle for this <see cref="Cursor"/>. 191/// Gets the size of this <see cref="Cursor"/> object. 220/// Duplicates this the Win32 handle of this <see cref="Cursor"/>. 348/// Draws this <see cref="Cursor"/> to a <see cref="Graphics"/>. 356/// Draws this <see cref="Cursor"/> to a <see cref="Graphics"/>. 435throw new ArgumentException(string.Format(SR.InvalidPictureType, nameof(picture), nameof(Cursor)), paramName); 466/// Retrieves a human readable string representing this <see cref="Cursor"/>. 470public static bool operator ==(Cursor? left, Cursor? right) 475public static bool operator !=(Cursor? left, Cursor? right) => !(left == right); 479public override bool Equals(object? obj) => obj is Cursor cursor && this == cursor;
System\Windows\Forms\Input\CursorConverter.cs (3)
85if (value is Cursor cursor) 106Cursor? knownCursor = (Cursor?)prop.GetValue(obj: null, index: null);
System\Windows\Forms\Input\Cursors.cs (56)
11private static Cursor? s_appStarting; 12private static Cursor? s_arrow; 13private static Cursor? s_cross; 14private static Cursor? s_defaultCursor; 15private static Cursor? s_iBeam; 16private static Cursor? s_no; 17private static Cursor? s_sizeAll; 18private static Cursor? s_sizeNESW; 19private static Cursor? s_sizeNS; 20private static Cursor? s_sizeNWSE; 21private static Cursor? s_sizeWE; 22private static Cursor? s_upArrow; 23private static Cursor? s_wait; 24private static Cursor? s_help; 25private static Cursor? s_hSplit; 26private static Cursor? s_vSplit; 27private static Cursor? s_noMove2D; 28private static Cursor? s_noMoveHoriz; 29private static Cursor? s_noMoveVert; 30private static Cursor? s_panEast; 31private static Cursor? s_panNE; 32private static Cursor? s_panNorth; 33private static Cursor? s_panNW; 34private static Cursor? s_panSE; 35private static Cursor? s_panSouth; 36private static Cursor? s_panSW; 37private static Cursor? s_panWest; 38private static Cursor? s_hand; 40public static Cursor AppStarting => s_appStarting ??= new(PInvoke.IDC_APPSTARTING, nameof(AppStarting)); 41public static Cursor Arrow => s_arrow ??= new(PInvoke.IDC_ARROW, nameof(Arrow)); 42public static Cursor Cross => s_cross ??= new(PInvoke.IDC_CROSS, nameof(Cross)); 43public static Cursor Default => s_defaultCursor ??= new(PInvoke.IDC_ARROW, nameof(Default)); 44public static Cursor IBeam => s_iBeam ??= new(PInvoke.IDC_IBEAM, nameof(IBeam)); 45public static Cursor No => s_no ??= new(PInvoke.IDC_NO, nameof(No)); 46public static Cursor SizeAll => s_sizeAll ??= new(PInvoke.IDC_SIZEALL, nameof(SizeAll)); 47public static Cursor SizeNESW => s_sizeNESW ??= new(PInvoke.IDC_SIZENESW, nameof(SizeNESW)); 48public static Cursor SizeNS => s_sizeNS ??= new(PInvoke.IDC_SIZENS, nameof(SizeNS)); 49public static Cursor SizeNWSE => s_sizeNWSE ??= new(PInvoke.IDC_SIZENWSE, nameof(SizeNWSE)); 50public static Cursor SizeWE => s_sizeWE ??= new(PInvoke.IDC_SIZEWE, nameof(SizeWE)); 51public static Cursor UpArrow => s_upArrow ??= new(PInvoke.IDC_UPARROW, nameof(UpArrow)); 52public static Cursor WaitCursor => s_wait ??= new(PInvoke.IDC_WAIT, nameof(WaitCursor)); 53public static Cursor Help => s_help ??= new(PInvoke.IDC_HELP, nameof(Help)); 54public static Cursor Hand => s_hand ??= new(PInvoke.IDC_HAND, nameof(Hand)); 55public static Cursor HSplit => s_hSplit ??= new("hsplit.cur", nameof(HSplit)); 56public static Cursor VSplit => s_vSplit ??= new("vsplit.cur", nameof(VSplit)); 57public static Cursor NoMove2D => s_noMove2D ??= new("nomove2d.cur", nameof(NoMove2D)); 58public static Cursor NoMoveHoriz => s_noMoveHoriz ??= new("nomoveh.cur", nameof(NoMoveHoriz)); 59public static Cursor NoMoveVert => s_noMoveVert ??= new("nomovev.cur", nameof(NoMoveVert)); 60public static Cursor PanEast => s_panEast ??= new("east.cur", nameof(PanEast)); 61public static Cursor PanNE => s_panNE ??= new("ne.cur", nameof(PanNE)); 62public static Cursor PanNorth => s_panNorth ??= new("north.cur", nameof(PanNorth)); 63public static Cursor PanNW => s_panNW ??= new("nw.cur", nameof(PanNW)); 64public static Cursor PanSE => s_panSE ??= new("se.cur", nameof(PanSE)); 65public static Cursor PanSouth => s_panSouth ??= new("south.cur", nameof(PanSouth)); 66public static Cursor PanSW => s_panSW ??= new("sw.cur", nameof(PanSW)); 67public static Cursor PanWest => s_panWest ??= new("west.cur", nameof(PanWest));
System\Windows\Forms\Layout\Containers\SplitContainer.cs (3)
61private Cursor? _overrideCursor; 436private Cursor? OverrideCursor 2272Cursor.Current = OverrideCursor ?? Cursor;
System\Windows\Forms\OLE\DropSource.cs (1)
93if (!lastHwndTarget.IsNull && (Cursor.Position is Point point))
System\Windows\Forms\Printing\PrintPreviewDialog.cs (1)
435public override Cursor Cursor
System\Windows\Forms\ToolTip\ToolTip.cs (8)
1313_ = Cursor.Current; 1314Point cursorLocation = Cursor.Position; 2008Point cursorLocation = Cursor.Position; 2086Screen screen = Screen.FromPoint(Cursor.Position); 2146Cursor? currentCursor = Cursor.Current; 2147Point cursorPos = Cursor.Position; 2239Screen screen = Screen.FromPoint(Cursor.Position);
System.Windows.Forms.Design (159)
System\ComponentModel\Design\CollectionEditor.SplitButton.cs (2)
179if (Parent is not null && Bounds.Contains(Parent.PointToClient(Cursor.Position)) && !_dropDownRectangle.Contains(mevent.Location)) 282if (Parent is not null && Bounds.Contains(Parent.PointToClient(Cursor.Position)))
System\ComponentModel\Design\Serialization\BasicDesignerLoader.cs (4)
289Cursor? oldCursor = Cursor.Current; 290Cursor.Current = Cursors.WaitCursor; 336Cursor.Current = oldCursor;
System\Drawing\Design\CursorEditor.CursorUI.cs (3)
27_cursorConverter = TypeDescriptor.GetConverter(typeof(Cursor)); 63Cursor cursor = (Cursor)Items[e.Index];
System\Windows\Forms\Design\Behavior\Behavior.cs (1)
43public virtual Cursor Cursor => Cursors.Default;
System\Windows\Forms\Design\Behavior\BehaviorService.cs (3)
494Cursor? hitTestCursor = Adorners[i].Glyphs[j].GetHitTest(pt); 521Cursor cursor = Cursors.Default; 581private void SetAppropriateCursor(Cursor cursor)
System\Windows\Forms\Design\Behavior\ComponentGlyph.cs (1)
42public override Cursor? GetHitTest(Point p) => null;
System\Windows\Forms\Design\Behavior\ContainerSelectorBehavior.cs (1)
154Cursor.Position = controlOrigin;
System\Windows\Forms\Design\Behavior\ContainerSelectorGlyph.cs (1)
39public override Cursor? GetHitTest(Point p)
System\Windows\Forms\Design\Behavior\ControlBodyGlyph.cs (4)
17private readonly Cursor? _hitTestCursor; // cursor used to hit test 25Cursor? cursor, 35public ControlBodyGlyph(Rectangle bounds, Cursor? cursor, IComponent? relatedComponent, Behavior? behavior) 53public override Cursor? GetHitTest(Point p)
System\Windows\Forms\Design\Behavior\DesignerActionGlyph.cs (1)
87public override Cursor? GetHitTest(Point p)
System\Windows\Forms\Design\Behavior\DropSourceBehavior.cs (1)
630Cursor.Current = Cursors.Default;
System\Windows\Forms\Design\Behavior\Glyph.cs (1)
47public abstract Cursor? GetHitTest(Point p);
System\Windows\Forms\Design\Behavior\ResizeBehavior.cs (2)
46private Cursor _cursor = Cursors.Default; // used to set the correct cursor during resizing 78public override Cursor Cursor
System\Windows\Forms\Design\Behavior\SelectionGlyphBase.cs (3)
16protected Cursor? hitTestCursor; // the cursor returned if hit test is positive 37public override Cursor? GetHitTest(Point p) 50public Cursor? HitTestCursor
System\Windows\Forms\Design\Behavior\TableLayoutPanelResizeGlyph.cs (3)
13private readonly Cursor _hitTestCursor; 20internal TableLayoutPanelResizeGlyph(Rectangle controlBounds, TableLayoutStyle style, Cursor hitTestCursor, Behavior behavior) : base(behavior) 48public override Cursor GetHitTest(Point p)
System\Windows\Forms\Design\Behavior\ToolStripPanelSelectionGlyph.cs (2)
25internal ToolStripPanelSelectionGlyph(Rectangle bounds, Cursor cursor, IComponent relatedComponent, IServiceProvider? _provider, ToolStripPanelSelectionBehavior behavior) : base(bounds, cursor, relatedComponent, behavior) 205public override Cursor? GetHitTest(Point p)
System\Windows\Forms\Design\ChangeToolStripParentVerb.cs (4)
34Cursor current = Cursor.Current; 39Cursor.Current = Cursors.WaitCursor; 116Cursor.Current = current;
System\Windows\Forms\Design\CommandSet.cs (45)
697Cursor.Current = Cursors.Default; 977Cursor? oldCursor = Cursor.Current; 980Cursor.Current = Cursors.WaitCursor; 1108Cursor.Current = oldCursor; 1125Cursor? oldCursor = Cursor.Current; 1128Cursor.Current = Cursors.WaitCursor; 1228Cursor.Current = oldCursor; 1245Cursor? oldCursor = Cursor.Current; 1248Cursor.Current = Cursors.WaitCursor; 1381Cursor.Current = oldCursor; 1395Cursor? oldCursor = Cursor.Current; 1398Cursor.Current = Cursors.WaitCursor; 1426Cursor.Current = oldCursor; 1440Cursor? oldCursor = Cursor.Current; 1443Cursor.Current = Cursors.WaitCursor; 1574Cursor.Current = oldCursor; 1588Cursor? oldCursor = Cursor.Current; 1591Cursor.Current = Cursors.WaitCursor; 1820Cursor.Current = oldCursor; 1831Cursor? oldCursor = Cursor.Current; 1835Cursor.Current = Cursors.WaitCursor; 2182Cursor.Current = oldCursor; 2201Cursor? oldCursor = Cursor.Current; 2204Cursor.Current = Cursors.WaitCursor; 2232Cursor.Current = oldCursor; 2283Cursor? oldCursor = Cursor.Current; 2286Cursor.Current = Cursors.WaitCursor; 2367Cursor.Current = oldCursor; 2381Cursor? oldCursor = Cursor.Current; 2387Cursor.Current = Cursors.WaitCursor; 2444Cursor.Current = oldCursor; 2519Cursor? oldCursor = Cursor.Current; 2524Cursor.Current = Cursors.WaitCursor; 2878Cursor.Current = oldCursor;
System\Windows\Forms\Design\ComponentTray.cs (14)
655Cursor.Clip = Rectangle.Empty; 1192Cursor.Clip = Rectangle.Empty; 1267Cursor.Clip = RectangleToScreen(ClientRectangle); 1334Cursor.Clip = Rectangle.Empty; 1496Cursor.Current = Cursors.Default; 2256Cursor.Clip = Rectangle.Empty; 2379Cursor.Current = Cursors.Default; 2386Cursor.Current = Cursors.Default; 2393Cursor.Current = Cursors.Default; 2399Cursor.Current = Cursors.Default; 2403Cursor.Current = Cursors.Cross; 2407Cursor.Current = Cursors.SizeAll; 2667public Cursor GetHitTest(Point p) 2671Cursor hitTestCursor = _traySelectionAdorner.Glyphs[i].GetHitTest(p);
System\Windows\Forms\Design\ControlCommandSet.cs (8)
845Cursor oldCursor = Cursor.Current; 848Cursor.Current = Cursors.WaitCursor; 905Cursor.Current = oldCursor; 978Cursor oldCursor = Cursor.Current; 981Cursor.Current = Cursors.WaitCursor; 1129Cursor.Current = oldCursor;
System\Windows\Forms\Design\ControlDesigner.cs (7)
679Cursor? cursor = Cursor.Current; 1579Cursor.Current = Cursors.Default; 1604Cursor.Current = Cursors.Default; 1610Cursor.Current = Cursors.Default; 1614Cursor.Current = Cursors.SizeAll; 2203location = Cursor.Position;
System\Windows\Forms\Design\DesignerUtils.cs (4)
739Cursor? oldCursor = Cursor.Current; 742Cursor.Current = Cursors.WaitCursor; 784Cursor.Current = oldCursor;
System\Windows\Forms\Design\OleDragDropHandler.cs (8)
147Cursor? oldCursor = Cursor.Current; 148Cursor.Current = Cursors.WaitCursor; 251Cursor.Current = oldCursor; 658Cursor? oldCursor = Cursor.Current; 662Cursor.Current = Cursors.WaitCursor; 855Cursor.Current = oldCursor;
System\Windows\Forms\Design\ParentControlDesigner.cs (5)
1014return new ControlBodyGlyph(nonClipRect, Cursor.Current, Control, this); 1025return new ControlBodyGlyph(controlRect, Cursor.Current, Control, this); 1778Cursor.Clip = Rectangle.Empty; 2073Cursor.Current = Cursors.Default; 2079Cursor.Current = Cursors.Default;
System\Windows\Forms\Design\SelectionUIHandler.cs (1)
222Cursor.Clip = Rectangle.Empty;
System\Windows\Forms\Design\SelectionUIService.ContainerSelectionUIItem.cs (1)
19public override Cursor? GetCursorAtPoint(Point point)
System\Windows\Forms\Design\SelectionUIService.cs (2)
800Cursor? cursor = item.GetCursorAtPoint(clientCoords); 812Cursor? cursor = item.GetCursorAtPoint(clientCoords);
System\Windows\Forms\Design\SelectionUIService.SelectionUIItem.cs (6)
44internal static readonly Cursor[] s_activeCursorArrays = 52internal static readonly Cursor[] s_inactiveCursorArray = 60internal Cursor[] _cursors; // array of cursors for each grab location 189public virtual Cursor? GetCursorAtPoint(Point point) 191Cursor? cursor = null; 425_cursors = new Cursor[8];
System\Windows\Forms\Design\SplitContainerDesigner.cs (2)
207ControlBodyGlyph bodyGlyph = new(translatedBounds, Cursor.Current, _splitterPanel1, panelDesigner); 217ControlBodyGlyph bodyGlyph = new(translatedBounds, Cursor.Current, _splitterPanel2, panelDesigner);
System\Windows\Forms\Design\StandardMenuStripVerb.cs (4)
45Cursor current = Cursor.Current; 48Cursor.Current = Cursors.WaitCursor; 60Cursor.Current = current;
System\Windows\Forms\Design\TabControlDesigner.cs (1)
626                   Point p = Cursor.Position;
System\Windows\Forms\Design\TableLayoutPanelDesigner.cs (2)
1545Cursor.Current = Cursors.No; 1557Cursor.Current = Cursors.No;
System\Windows\Forms\Design\TabOrder.cs (1)
639=> Cursor.Current = _ctlHover is not null ? Cursors.Cross : Cursors.Default;
System\Windows\Forms\Design\TabPageDesigner.cs (1)
49ControlBodyGlyph g = new(translatedBounds, Cursor.Current, Control, this);
System\Windows\Forms\Design\ToolStripContainerDesigner.cs (1)
241ControlBodyGlyph bodyGlyph = new(translatedBounds, Cursor.Current, currentPanel, panelDesigner);
System\Windows\Forms\Design\ToolStripDesigner.cs (1)
2115Cursor.Current = Cursors.Default;
System\Windows\Forms\Design\ToolStripDropDownDesigner.cs (1)
699_dummyToolStripGlyph = new ControlBodyGlyph(r, Cursor.Current, _menuItem, new ContextMenuStripBehavior());
System\Windows\Forms\Design\ToolStripItemBehavior.cs (3)
61if (ToolStripDesigner.s_lastCursorPosition != Point.Empty && ToolStripDesigner.s_lastCursorPosition == Cursor.Position) 900if (ToolStripDesigner.s_lastCursorPosition != Point.Empty && ToolStripDesigner.s_lastCursorPosition == Cursor.Position) 915ToolStripDesigner.s_lastCursorPosition = Cursor.Position;
System\Windows\Forms\Design\ToolStripItemGlyph.cs (1)
29public override Cursor? GetHitTest(Point p)
System\Windows\Forms\Design\ToolStripKeyboardHandlingService.cs (1)
491Point p = Cursor.Position;
System\Windows\Forms\Design\ToolStripMenuItemDesigner.cs (1)
2611public override Cursor GetHitTest(Point p)
System\Windows\Forms\Design\ToolStripTemplateNode.cs (1)
510ToolStripDesigner.s_lastCursorPosition = Cursor.Position;
System.Windows.Forms.Design.Tests (2)
EnsureEditorsTests.cs (1)
59[InlineData(typeof(Cursor), typeof(CursorEditor))]
System\ComponentModel\Design\ByteViewerTests.cs (1)
1016public new Cursor DefaultCursor => base.DefaultCursor;
System.Windows.Forms.Tests (184)
System\Windows\Forms\AmbientPropertiesTests.cs (1)
39public void Cursor_Set_GetReturnsExpected(Cursor value)
System\Windows\Forms\AxHostTests.cs (9)
434public void AxHost_Cursor_Set_GetReturnsExpected(Cursor value) 449public void AxHost_Cursor_SetWithHandle_GetReturnsExpected(Cursor value) 464public void AxHost_Cursor_SetWithChildren_GetReturnsExpected(Cursor value) 486public void AxHost_Cursor_SetWithChildrenWithCursor_GetReturnsExpected(Cursor value) 488Cursor cursor1 = new(1); 489Cursor cursor2 = new(1); 1583using Cursor original = new("bitmaps/cursor.cur"); 3174public new Cursor DefaultCursor => base.DefaultCursor; 3232public static new object GetIPictureFromCursor(Cursor cursor) => AxHost.GetIPictureFromCursor(cursor);
System\Windows\Forms\ButtonBaseTests.cs (1)
9277public new Cursor DefaultCursor => base.DefaultCursor;
System\Windows\Forms\ButtonTests.cs (1)
3685public new Cursor DefaultCursor => base.DefaultCursor;
System\Windows\Forms\CheckBoxTests.cs (1)
640public new Cursor DefaultCursor => base.DefaultCursor;
System\Windows\Forms\ComboBoxTests.cs (1)
2829public new Cursor DefaultCursor => base.DefaultCursor;
System\Windows\Forms\ContainerControlTests.cs (1)
1419public new Cursor DefaultCursor => base.DefaultCursor;
System\Windows\Forms\ControlTests.cs (1)
1152public new Cursor DefaultCursor => base.DefaultCursor;
System\Windows\Forms\ControlTests.Handlers.cs (3)
1152Cursor childCursor1 = new(1); 1153Cursor childCursor2 = new(1); 4383Cursor cursor = new(1);
System\Windows\Forms\ControlTests.Methods.cs (1)
6427using Cursor cursor = new(1);
System\Windows\Forms\ControlTests.Properties.cs (29)
3713using Cursor cursor = new(1); 3728using Cursor cursor1 = new(1); 3729using Cursor cursor2 = new(2); 3748using Cursor cursor1 = new(1); 3749using Cursor cursor2 = new(2); 3768using Cursor cursor = new(1); 3780using Cursor cursor1 = new(1); 3781using Cursor cursor2 = new(2); 3799public Cursor DefaultCursorResult { get; } = new(1); 3801protected override Cursor DefaultCursor => DefaultCursorResult; 3806public void Control_Cursor_Set_GetReturnsExpected(Cursor value) 3823public void Control_Cursor_SetWithHandle_GetReturnsExpected(Cursor value) 3852public void Control_Cursor_SetWithChildren_GetReturnsExpected(Cursor value) 3874public void Control_Cursor_SetWithChildrenWithCursor_GetReturnsExpected(Cursor value) 3876Cursor cursor1 = new(1); 3877Cursor cursor2 = new(1); 3916using Cursor cursor1 = new(1); 3927using Cursor cursor2 = new(2); 3979using Cursor cursor1 = new(1); 3998using Cursor cursor2 = new(2); 4032using Cursor childCursor1 = new(1); 4033using Cursor childCursor2 = new(2); 4072using Cursor cursor1 = new(3); 4091using Cursor cursor2 = new(4); 10720Cursor cursor1 = Cursors.AppStarting; 10721Cursor cursor2 = Cursors.Arrow; 10894Cursor cursor1 = Cursors.AppStarting; 10895Cursor cursor2 = Cursors.Arrow; 10953using Cursor controlCursor = new(3);
System\Windows\Forms\CursorConverterTests.cs (8)
17[InlineData(typeof(Cursor), false)] 38using Cursor cursor = Assert.IsType<Cursor>(converter.ConvertFrom(data)); 66[InlineData(typeof(Cursor), false)] 129using Cursor sourceCursor = new(stream); 139using Cursor sourceCursor = new(fileName); 194ICollection<Cursor> values = converter.GetStandardValues().Cast<Cursor>().ToArray();
System\Windows\Forms\CursorsTests.cs (7)
15static Func<Cursor> I(Func<Cursor> factory) => factory; 49public void Cursors_KnownCursor_Get_ReturnsExpected(Func<Cursor> getCursor) 51Cursor cursor = getCursor(); 69Assert.NotNull((Cursor)property.GetValue(null, tempIndex)); 75public void Cursors_ToString_KnownCursor_ReturnsExpected(Func<Cursor> getCursor) 78Cursor cursor = getCursor();
System\Windows\Forms\CursorTests.cs (65)
23public CursorTestsFixture() => Cursor.Position = default; 25public void Dispose() => Cursor.Position = default; 32Cursor sourceCursor = Cursors.AppStarting; 33using Cursor cursor = new(sourceCursor.Handle); 43using Cursor cursor = new(-1000); 67using Cursor cursor = new(stream); 79using Cursor cursor = new(stream); 118using Cursor cursor = new(fileName); 155using Cursor cursor = new(typeof(PropertyTabTests), "CustomPropertyTab"); 180Rectangle clip = Cursor.Clip; 192Rectangle clip = Cursor.Clip; 201Cursor.Clip = new Rectangle(1, 2, 3, 4); 202Assert.True(Cursor.Clip.X >= 0); 203Assert.True(Cursor.Clip.Y >= 0); 204Assert.True(Cursor.Clip.Width >= 0); 205Assert.True(Cursor.Clip.Height >= 0); 210Cursor.Clip = new Rectangle(0, 0, 0, 0); 211Assert.Equal(virtualScreen, Cursor.Clip); 214Cursor.Clip = Rectangle.Inflate(virtualScreen, 10, 10); 215Assert.Equal(virtualScreen, Cursor.Clip); 222Cursor.Clip = clip; 229Cursor cursor = Cursor.Current; 236Assert.NotSame(cursor, Cursor.Current); 242Cursor current = Cursor.Current; 246Cursor value = new(Cursors.AppStarting.Handle); 247Cursor.Current = value; 248Assert.Equal(value.Handle, Cursor.Current.Handle); 251Cursor.Current = null; 252Assert.Null(Cursor.Current); 256Cursor.Current = current; 263Point position = Cursor.Position; 275Point position = Cursor.Position; 278Cursor.Position = new Point(1, 2); 279position = Cursor.Position; 284Cursor.Position = new Point(virtualScreen.X - 1, virtualScreen.Y - 1); 285position = Cursor.Position; 291Cursor.Position = position; 298Cursor.Show(); 299Cursor.Show(); 305Cursor.Hide(); 306Cursor.Hide(); 313using Cursor cursor = new(2) 327using Cursor sourceCursor = new(Path.Combine("bitmaps", "10x16_one_entry_32bit.ico")); 332using Cursor cursor = new(sourceCursor.Handle); 342Cursor cursor = new(Path.Combine("bitmaps", "10x16_one_entry_32bit.ico")); 355Cursor cursor = new(2); 378using Cursor cursor = new(Path.Combine("bitmaps", "10x16_one_entry_32bit.ico")); 388using Cursor cursor = new(-1000); 397Cursor cursor = Cursors.AppStarting; 404Cursor cursor = Cursors.AppStarting; 415using Cursor cursor = new(Path.Combine("bitmaps", "10x16_one_entry_32bit.ico")); 425using Cursor cursor = new(-1000); 434Cursor cursor = Cursors.AppStarting; 441Cursor cursor = Cursors.AppStarting; 450Cursor cursor = new(Cursors.AppStarting.Handle); 461public void Cursor_Equals_InvokeObject_ReturnsExpected(Cursor cursor, object obj, bool expected) 464if (obj is Cursor) 472Cursor cursor = new(2); 484public void Cursor_Equals_InvokeCursor_ReturnsExpected(Cursor cursor1, Cursor cursor2, bool expected) 493Cursor cursor = Cursors.AppStarting; 500using Cursor cursor = new(Path.Combine("bitmaps", "10x16_one_entry_32bit.ico")); 507using Cursor cursor = new(2);
System\Windows\Forms\DataGridViewTests.cs (1)
20Cursor.Position = default;
System\Windows\Forms\DataGridViewTextBoxEditingControlTests.cs (1)
2112public new Cursor DefaultCursor => base.DefaultCursor;
System\Windows\Forms\DateTimePickerTests.cs (1)
1014public new Cursor DefaultCursor => base.DefaultCursor;
System\Windows\Forms\Design\ComponentEditorFormTests.cs (1)
388public new Cursor DefaultCursor => base.DefaultCursor;
System\Windows\Forms\Design\ComponentEditorPageTests.cs (1)
891public new Cursor DefaultCursor => base.DefaultCursor;
System\Windows\Forms\DomainUpDownTests.cs (1)
1478public new Cursor DefaultCursor => base.DefaultCursor;
System\Windows\Forms\EmbeddedResourceTests.cs (1)
236using Cursor cursor = new(stream);
System\Windows\Forms\FlowLayoutPanelTests.cs (1)
438public new Cursor DefaultCursor => base.DefaultCursor;
System\Windows\Forms\FormTests.cs (1)
2698public new Cursor DefaultCursor => base.DefaultCursor;
System\Windows\Forms\GroupBoxTests.cs (1)
2303public new Cursor DefaultCursor => base.DefaultCursor;
System\Windows\Forms\HScrollBarTests.cs (1)
252public new Cursor DefaultCursor => base.DefaultCursor;
System\Windows\Forms\LabelTests.cs (1)
887public new Cursor DefaultCursor => base.DefaultCursor;
System\Windows\Forms\ListBoxTests.cs (1)
6410public new Cursor DefaultCursor => base.DefaultCursor;
System\Windows\Forms\ListControlTests.cs (1)
2918public new Cursor DefaultCursor => base.DefaultCursor;
System\Windows\Forms\ListViewItem.IKeyboardToolTipTests.cs (3)
697Point initialPosition = Cursor.Position; 717Cursor.Position = position; 722Cursor.Position = initialPosition;
System\Windows\Forms\ListViewTests.cs (1)
6105public new Cursor DefaultCursor => base.DefaultCursor;
System\Windows\Forms\MdiControlStripTests.cs (1)
360public new Cursor DefaultCursor => base.DefaultCursor;
System\Windows\Forms\MenuStripTests.cs (1)
856public new Cursor DefaultCursor => base.DefaultCursor;
System\Windows\Forms\MonthCalendarTests.cs (1)
4734public new Cursor DefaultCursor => base.DefaultCursor;
System\Windows\Forms\PanelTests.cs (1)
1160public new Cursor DefaultCursor => base.DefaultCursor;
System\Windows\Forms\PictureBoxTests.cs (1)
2846public new Cursor DefaultCursor => base.DefaultCursor;
System\Windows\Forms\ProgressBarTests.cs (1)
2590public new Cursor DefaultCursor => base.DefaultCursor;
System\Windows\Forms\PropertyGridTests.cs (1)
4149public new Cursor DefaultCursor => base.DefaultCursor;
System\Windows\Forms\RadioButtonTests.cs (1)
1533public new Cursor DefaultCursor => base.DefaultCursor;
System\Windows\Forms\RichTextBoxTests.cs (1)
10930public new Cursor DefaultCursor => base.DefaultCursor;
System\Windows\Forms\ScrollableControlTests.cs (1)
2578public new Cursor DefaultCursor => base.DefaultCursor;
System\Windows\Forms\ScrollBarTests.cs (1)
3166public new Cursor DefaultCursor => base.DefaultCursor;
System\Windows\Forms\SplitterTests.cs (2)
382public void Splitter_DefaultCursor_GetWithDockStyle_ReturnsExpected(DockStyle dock, Cursor expected) 2311public new Cursor DefaultCursor => base.DefaultCursor;
System\Windows\Forms\StatusStripTests.cs (1)
1278public new Cursor DefaultCursor => base.DefaultCursor;
System\Windows\Forms\TabControlTests.cs (1)
5727public new Cursor DefaultCursor => base.DefaultCursor;
System\Windows\Forms\TableLayoutPanelTests.cs (1)
2177public new Cursor DefaultCursor => base.DefaultCursor;
System\Windows\Forms\TabPageTests.cs (1)
5241public new Cursor DefaultCursor => base.DefaultCursor;
System\Windows\Forms\ToolStripContentPanelTests.cs (1)
2022public new Cursor DefaultCursor => base.DefaultCursor;
System\Windows\Forms\ToolStripDropDownTests.cs (1)
5096public new Cursor DefaultCursor => base.DefaultCursor;
System\Windows\Forms\ToolStripPanelTests.cs (1)
365public new Cursor DefaultCursor => base.DefaultCursor;
System\Windows\Forms\ToolStripTests.cs (4)
1331public void ToolStrip_Cursor_Set_GetReturnsExpected(Cursor value) 1360using Cursor cursor1 = new(1); 1371using Cursor cursor2 = new(2); 7532public new Cursor DefaultCursor => base.DefaultCursor;
System\Windows\Forms\TreeNode.IKeyboardToolTipTests.cs (3)
369Point initialPosition = Cursor.Position; 388Cursor.Position = position; 393Cursor.Position = initialPosition;
System\Windows\Forms\TreeViewTests.cs (1)
7578public new Cursor DefaultCursor => base.DefaultCursor;
System\Windows\Forms\UpDownBaseTests.cs (1)
3111public new Cursor DefaultCursor => base.DefaultCursor;
System\Windows\Forms\UserControlTests.cs (1)
1803public new Cursor DefaultCursor => base.DefaultCursor;
System\Windows\Forms\VScrollBarTests.cs (1)
242public new Cursor DefaultCursor => base.DefaultCursor;
System\Windows\Forms\WebBrowserTests.cs (1)
4672public new Cursor DefaultCursor => base.DefaultCursor;
TextBoxBaseTests.cs (1)
7689public new Cursor DefaultCursor => base.DefaultCursor;
TextBoxTests.cs (1)
687public new Cursor DefaultCursor => base.DefaultCursor;
ToolStripContainerTests.cs (1)
169var value = Cursors.Hand;
TrackBarTests.cs (1)
3284public new Cursor DefaultCursor => base.DefaultCursor;
WebBrowserBaseTests.cs (1)
892public new Cursor DefaultCursor => base.DefaultCursor;
System.Windows.Forms.TestUtilities (2)
CommonTestHelperEx.cs (2)
99public static TheoryData<Cursor> GetCursorTheoryData() 101TheoryData<Cursor> data = new()
System.Windows.Forms.UI.IntegrationTests (8)
DragDropTests.cs (4)
650private Cursor? _myNoDropCursor; 651private Cursor? _myNormalCursor; 805Cursor.Current = _myNormalCursor; 807Cursor.Current = _myNoDropCursor;
Infra\ControlTestBase.cs (2)
69_mousePosition = Cursor.Position; 96Cursor.Position = mousePosition;
Infra\ScreenshotService.cs (2)
73if (Cursor.Current is { } cursor) 75Rectangle bounds = new(Cursor.Position - (Size)cursor.HotSpot, cursor.Size);
WindowsFormsIntegration (12)
System\Windows\Integration\Convert.cs (9)
26private static Dictionary<SWF.Cursor, SWI.Cursor> _toSystemWindowsInputCursorDictionary; 27private static Dictionary<SWF.Cursor, SWI.Cursor> ToSystemWindowsInputCursorDictionary 33_toSystemWindowsInputCursorDictionary = new Dictionary<SWF.Cursor, System.Windows.Input.Cursor>(); 66private static Dictionary<SWI.Cursor, SWF.Cursor> _toSystemWindowsFormsCursorDictionary; 67private static Dictionary<SWI.Cursor, SWF.Cursor> ToSystemWindowsFormsCursorDictionary 73_toSystemWindowsFormsCursorDictionary = new Dictionary<SWI.Cursor, SWF.Cursor>(); 109internal static SWI.Cursor ToSystemWindowsInputCursor(SWF.Cursor swfCursor) 123internal static SWF.Cursor ToSystemWindowsFormsCursor(SWI.Cursor swiCursor) 125SWF.Cursor swfCursor;
System\Windows\Integration\ElementHostPropertyMap.cs (2)
100SWF.Cursor fromCursor = value as SWF.Cursor;
System\Windows\Integration\WindowsFormsHost.cs (1)
793public override Cursor Cursor
WinFormsControlsTest (1)
ListViewTest.cs (1)
29Point pos = Cursor.Position;