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