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)
1585
using Cursor original =
new
("bitmaps/cursor.cur");
System\Windows\Forms\CursorConverterTests.cs (5)
108
Assert.Throws<NotSupportedException>(() => converter.ConvertTo(new
Cursor
(Cursors.AppStarting.Handle), typeof(InstanceDescriptor)));
131
using Cursor sourceCursor =
new
(stream);
141
using Cursor sourceCursor =
new
(fileName);
150
Assert.Throws<InvalidOperationException>(() => converter.ConvertTo(new
Cursor
(Cursors.AppStarting.Handle), typeof(byte[])));
240
string converted = (string)converter.ConvertTo(new
Cursor
(Cursors.Default.Handle), typeof(string));
System\Windows\Forms\CursorTests.cs (25)
35
using Cursor cursor =
new
(sourceCursor.Handle);
55
Assert.Throws<ArgumentException>("handle", () => new
Cursor
(IntPtr.Zero));
69
using Cursor cursor =
new
(stream);
81
using Cursor cursor =
new
(stream);
88
Assert.Throws<ArgumentException>("stream", () => new
Cursor
(new MemoryStream()));
94
Assert.Throws<ArgumentNullException>("stream", () => new
Cursor
((Stream)null));
113
Assert.Throws<ArgumentException>("stream", () => new
Cursor
(stream));
120
using Cursor cursor =
new
(fileName);
130
Assert.Throws<ArgumentNullException>("path", () => new
Cursor
((string)null));
138
Assert.Throws<ArgumentException>("path", () => new
Cursor
(fileName));
144
Assert.Throws<FileNotFoundException>(() => new
Cursor
("NoSuchFile"));
151
Assert.Throws<ArgumentException>("fileName", () => new
Cursor
(fileName));
157
using Cursor cursor =
new
(typeof(PropertyTabTests), "CustomPropertyTab");
167
Assert.Throws<ArgumentNullException>("type", () => new
Cursor
((Type)null, "resource"));
176
Assert.Throws<ArgumentNullException>("stream", () => new
Cursor
(type, resource));
248
Cursor value =
new
(Cursors.AppStarting.Handle);
329
using Cursor sourceCursor =
new
(Path.Join("bitmaps", "10x16_one_entry_32bit.ico"));
334
using Cursor cursor =
new
(sourceCursor.Handle);
344
Cursor cursor =
new
(Path.Join("bitmaps", "10x16_one_entry_32bit.ico"));
380
using Cursor cursor =
new
(Path.Join("bitmaps", "10x16_one_entry_32bit.ico"));
417
using Cursor cursor =
new
(Path.Join("bitmaps", "10x16_one_entry_32bit.ico"));
452
Cursor cursor =
new
(Cursors.AppStarting.Handle);
454
yield return new object[] { cursor, new
Cursor
(Cursors.AppStarting.Handle), true };
455
yield return new object[] { cursor, new
Cursor
(Cursors.Arrow.Handle), false };
502
using Cursor cursor =
new
(Path.Join("bitmaps", "10x16_one_entry_32bit.ico"));
System\Windows\Forms\EmbeddedResourceTests.cs (1)
238
using 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");
521 references to Cursor
System.Windows.Forms (150)
System\Windows\Forms\ActiveX\AxHost.cs (2)
310
public override
Cursor
Cursor
3537
protected static object? GetIPictureFromCursor(
Cursor
? cursor)
System\Windows\Forms\AmbientProperties.cs (1)
23
public
Cursor
? Cursor { get; set; }
System\Windows\Forms\Control.cs (9)
1458
public virtual
Cursor
Cursor
1467
if (Properties.TryGetValue(s_cursorProperty, out
Cursor
? cursor))
1473
Cursor
localDefault = DefaultCursor;
1480
Cursor
? localCursor = Properties.GetValueOrDefault<
Cursor
>(s_cursorProperty);
1481
Cursor
resolvedCursor = Cursor;
1552
protected virtual
Cursor
DefaultCursor => Cursors.Default;
2950
Cursor
? oldCursor = null;
11861
Cursor
.Current = Cursor;
System\Windows\Forms\Controls\ComboBox\ComboBox.cs (1)
1753
Cursor
.Current = Cursor;
System\Windows\Forms\Controls\DataGridView\DataGridView.cs (3)
255
private
Cursor
? _oldCursor;
1856
internal
Cursor
CursorInternal
4072
public
Cursor
? UserSetCursor => _dataGridViewState1[State1_CustomCursorSet]
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (2)
3380
Cursor
.Clip = RectangleToScreen(cursorClip);
25595
Cursor
.Clip = Rectangle.Empty;
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxEditingControl.cs (1)
67
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)
78
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)
4374
Point pos =
Cursor
.Position;
5825
pt = PointToClient(
Cursor
.Position)
5867
pt = PointToClient(
Cursor
.Position)
5973
AnnounceColumnHeader(
Cursor
.Position);
6328
pt = PointToClient(
Cursor
.Position)
6650
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;
5240
Point mouseLoc =
Cursor
.Position;
System\Windows\Forms\Controls\RichTextBox\RichTextBox.cs (1)
3468
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)
483
public override
Cursor
Cursor
4502
if (_currentlyActiveTooltipItem is not null && !GetToolStripState(STATE_DRAGGING) &&
Cursor
.Current is { } currentCursor)
4504
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)
959
cursorLoc.Y =
Cursor
.Position.Y;
964
cursorLoc.X =
Cursor
.Position.X;
967
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\Unsupported\DataGrid\DataGrid.cs (1)
156
public override
Cursor
Cursor
System\Windows\Forms\Controls\WebBrowser\WebBrowserBase.cs (1)
1322
public override
Cursor
Cursor
System\Windows\Forms\Form.cs (1)
4356
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;
2008
Point cursorLocation =
Cursor
.Position;
2086
Screen screen = Screen.FromPoint(
Cursor
.Position);
2146
Cursor
? currentCursor =
Cursor
.Current;
2147
Point cursorPos =
Cursor
.Position;
2239
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;
578
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)
156
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)
11
private readonly
Cursor
_hitTestCursor;
21
Cursor
hitTestCursor,
51
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)
694
Cursor
? cursor =
Cursor
.Current;
1594
Cursor
.Current = Cursors.Default;
1619
Cursor
.Current = Cursors.Default;
1625
Cursor
.Current = Cursors.Default;
1629
Cursor
.Current = Cursors.SizeAll;
2218
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);
1778
Cursor
.Clip = Rectangle.Empty;
2073
Cursor
.Current = Cursors.Default;
2079
Cursor
.Current = Cursors.Default;
System\Windows\Forms\Design\SelectionUIHandler.cs (1)
192
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)
621
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)
2158
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)
891
if (ToolStripDesigner.s_lastCursorPosition != Point.Empty && ToolStripDesigner.s_lastCursorPosition ==
Cursor
.Position)
906
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)
2608
public override
Cursor
GetHitTest(Point p)
System\Windows\Forms\Design\ToolStripTemplateNode.cs (1)
480
ToolStripDesigner.s_lastCursorPosition =
Cursor
.Position;
System.Windows.Forms.Design.Tests (5)
EnsureEditorsTests.cs (1)
61
[InlineData(typeof(
Cursor
), typeof(CursorEditor))]
System\ComponentModel\Design\ByteViewerTests.cs (1)
1018
public new
Cursor
DefaultCursor => base.DefaultCursor;
System\Windows\Forms\Design\SelectionUIHandlerTests.cs (1)
166
Cursor
expectedCursor = Cursors.Hand;
System\Windows\Forms\Design\TabOrderTests.cs (2)
161
Cursor
.Current.Should().Be(Cursors.Default);
165
Cursor
.Current.Should().Be(Cursors.Cross);
System.Windows.Forms.Tests (184)
System\Windows\Forms\AmbientPropertiesTests.cs (1)
41
public void Cursor_Set_GetReturnsExpected(
Cursor
value)
System\Windows\Forms\AxHostTests.cs (9)
436
public void AxHost_Cursor_Set_GetReturnsExpected(
Cursor
value)
451
public void AxHost_Cursor_SetWithHandle_GetReturnsExpected(
Cursor
value)
466
public void AxHost_Cursor_SetWithChildren_GetReturnsExpected(
Cursor
value)
488
public void AxHost_Cursor_SetWithChildrenWithCursor_GetReturnsExpected(
Cursor
value)
490
Cursor
cursor1 = new(1);
491
Cursor
cursor2 = new(1);
1585
using
Cursor
original = new("bitmaps/cursor.cur");
3176
public new
Cursor
DefaultCursor => base.DefaultCursor;
3234
public static new object GetIPictureFromCursor(
Cursor
cursor) => AxHost.GetIPictureFromCursor(cursor);
System\Windows\Forms\ButtonBaseTests.cs (1)
9279
public new
Cursor
DefaultCursor => base.DefaultCursor;
System\Windows\Forms\ButtonTests.cs (1)
3687
public new
Cursor
DefaultCursor => base.DefaultCursor;
System\Windows\Forms\CheckBoxTests.cs (1)
642
public new
Cursor
DefaultCursor => base.DefaultCursor;
System\Windows\Forms\ComboBoxTests.cs (1)
2831
public new
Cursor
DefaultCursor => base.DefaultCursor;
System\Windows\Forms\ContainerControlTests.cs (1)
1421
public new
Cursor
DefaultCursor => base.DefaultCursor;
System\Windows\Forms\ControlTests.cs (1)
1154
public new
Cursor
DefaultCursor => base.DefaultCursor;
System\Windows\Forms\ControlTests.Handlers.cs (3)
1154
Cursor
childCursor1 = new(1);
1155
Cursor
childCursor2 = new(1);
4385
Cursor
cursor = new(1);
System\Windows\Forms\ControlTests.Methods.cs (1)
6387
using
Cursor
cursor = new(1);
System\Windows\Forms\ControlTests.Properties.cs (29)
3715
using
Cursor
cursor = new(1);
3730
using
Cursor
cursor1 = new(1);
3731
using
Cursor
cursor2 = new(2);
3750
using
Cursor
cursor1 = new(1);
3751
using
Cursor
cursor2 = new(2);
3770
using
Cursor
cursor = new(1);
3782
using
Cursor
cursor1 = new(1);
3783
using
Cursor
cursor2 = new(2);
3801
public
Cursor
DefaultCursorResult { get; } = new(1);
3803
protected override
Cursor
DefaultCursor => DefaultCursorResult;
3808
public void Control_Cursor_Set_GetReturnsExpected(
Cursor
value)
3825
public void Control_Cursor_SetWithHandle_GetReturnsExpected(
Cursor
value)
3854
public void Control_Cursor_SetWithChildren_GetReturnsExpected(
Cursor
value)
3876
public void Control_Cursor_SetWithChildrenWithCursor_GetReturnsExpected(
Cursor
value)
3878
Cursor
cursor1 = new(1);
3879
Cursor
cursor2 = new(1);
3918
using
Cursor
cursor1 = new(1);
3929
using
Cursor
cursor2 = new(2);
3981
using
Cursor
cursor1 = new(1);
4000
using
Cursor
cursor2 = new(2);
4034
using
Cursor
childCursor1 = new(1);
4035
using
Cursor
childCursor2 = new(2);
4074
using
Cursor
cursor1 = new(3);
4093
using
Cursor
cursor2 = new(4);
10722
Cursor
cursor1 = Cursors.AppStarting;
10723
Cursor
cursor2 = Cursors.Arrow;
10896
Cursor
cursor1 = Cursors.AppStarting;
10897
Cursor
cursor2 = Cursors.Arrow;
10955
using
Cursor
controlCursor = new(3);
System\Windows\Forms\CursorConverterTests.cs (8)
19
[InlineData(typeof(
Cursor
), false)]
40
using
Cursor
cursor = Assert.IsType<
Cursor
>(converter.ConvertFrom(data));
68
[InlineData(typeof(
Cursor
), false)]
131
using
Cursor
sourceCursor = new(stream);
141
using
Cursor
sourceCursor = new(fileName);
196
ICollection<
Cursor
> values = converter.GetStandardValues().Cast<
Cursor
>().ToArray();
System\Windows\Forms\CursorsTests.cs (7)
17
static Func<
Cursor
> I(Func<
Cursor
> factory) => factory;
51
public void Cursors_KnownCursor_Get_ReturnsExpected(Func<
Cursor
> getCursor)
53
Cursor
cursor = getCursor();
71
Assert.NotNull((
Cursor
)property.GetValue(null, tempIndex));
77
public void Cursors_ToString_KnownCursor_ReturnsExpected(Func<
Cursor
> getCursor)
80
Cursor
cursor = getCursor();
System\Windows\Forms\CursorTests.cs (65)
25
public CursorTestsFixture() =>
Cursor
.Position = default;
27
public void Dispose() =>
Cursor
.Position = default;
34
Cursor
sourceCursor = Cursors.AppStarting;
35
using
Cursor
cursor = new(sourceCursor.Handle);
45
using
Cursor
cursor = new(-1000);
69
using
Cursor
cursor = new(stream);
81
using
Cursor
cursor = new(stream);
120
using
Cursor
cursor = new(fileName);
157
using
Cursor
cursor = new(typeof(PropertyTabTests), "CustomPropertyTab");
182
Rectangle clip =
Cursor
.Clip;
194
Rectangle clip =
Cursor
.Clip;
203
Cursor
.Clip = new Rectangle(1, 2, 3, 4);
204
Assert.True(
Cursor
.Clip.X >= 0);
205
Assert.True(
Cursor
.Clip.Y >= 0);
206
Assert.True(
Cursor
.Clip.Width >= 0);
207
Assert.True(
Cursor
.Clip.Height >= 0);
212
Cursor
.Clip = new Rectangle(0, 0, 0, 0);
213
Assert.Equal(virtualScreen,
Cursor
.Clip);
216
Cursor
.Clip = Rectangle.Inflate(virtualScreen, 10, 10);
217
Assert.Equal(virtualScreen,
Cursor
.Clip);
224
Cursor
.Clip = clip;
231
Cursor
cursor =
Cursor
.Current;
238
Assert.NotSame(cursor,
Cursor
.Current);
244
Cursor
current =
Cursor
.Current;
248
Cursor
value = new(Cursors.AppStarting.Handle);
249
Cursor
.Current = value;
250
Assert.Equal(value.Handle,
Cursor
.Current.Handle);
253
Cursor
.Current = null;
254
Assert.Null(
Cursor
.Current);
258
Cursor
.Current = current;
265
Point position =
Cursor
.Position;
277
Point position =
Cursor
.Position;
280
Cursor
.Position = new Point(1, 2);
281
position =
Cursor
.Position;
286
Cursor
.Position = new Point(virtualScreen.X - 1, virtualScreen.Y - 1);
287
position =
Cursor
.Position;
293
Cursor
.Position = position;
300
Cursor
.Show();
301
Cursor
.Show();
307
Cursor
.Hide();
308
Cursor
.Hide();
315
using
Cursor
cursor = new(2)
329
using
Cursor
sourceCursor = new(Path.Join("bitmaps", "10x16_one_entry_32bit.ico"));
334
using
Cursor
cursor = new(sourceCursor.Handle);
344
Cursor
cursor = new(Path.Join("bitmaps", "10x16_one_entry_32bit.ico"));
357
Cursor
cursor = new(2);
380
using
Cursor
cursor = new(Path.Join("bitmaps", "10x16_one_entry_32bit.ico"));
390
using
Cursor
cursor = new(-1000);
399
Cursor
cursor = Cursors.AppStarting;
406
Cursor
cursor = Cursors.AppStarting;
417
using
Cursor
cursor = new(Path.Join("bitmaps", "10x16_one_entry_32bit.ico"));
427
using
Cursor
cursor = new(-1000);
436
Cursor
cursor = Cursors.AppStarting;
443
Cursor
cursor = Cursors.AppStarting;
452
Cursor
cursor = new(Cursors.AppStarting.Handle);
463
public void Cursor_Equals_InvokeObject_ReturnsExpected(
Cursor
cursor, object obj, bool expected)
466
if (obj is
Cursor
)
474
Cursor
cursor = new(2);
486
public void Cursor_Equals_InvokeCursor_ReturnsExpected(
Cursor
cursor1,
Cursor
cursor2, bool expected)
495
Cursor
cursor = Cursors.AppStarting;
502
using
Cursor
cursor = new(Path.Join("bitmaps", "10x16_one_entry_32bit.ico"));
509
using
Cursor
cursor = new(2);
System\Windows\Forms\DataGridViewTests.cs (1)
22
Cursor
.Position = default;
System\Windows\Forms\DataGridViewTextBoxEditingControlTests.cs (1)
2114
public new
Cursor
DefaultCursor => base.DefaultCursor;
System\Windows\Forms\DateTimePickerTests.cs (1)
1016
public new
Cursor
DefaultCursor => base.DefaultCursor;
System\Windows\Forms\Design\ComponentEditorFormTests.cs (1)
390
public new
Cursor
DefaultCursor => base.DefaultCursor;
System\Windows\Forms\Design\ComponentEditorPageTests.cs (1)
893
public new
Cursor
DefaultCursor => base.DefaultCursor;
System\Windows\Forms\DomainUpDownTests.cs (1)
1480
public new
Cursor
DefaultCursor => base.DefaultCursor;
System\Windows\Forms\EmbeddedResourceTests.cs (1)
238
using
Cursor
cursor = new(stream);
System\Windows\Forms\FlowLayoutPanelTests.cs (1)
440
public new
Cursor
DefaultCursor => base.DefaultCursor;
System\Windows\Forms\FormTests.cs (1)
2700
public new
Cursor
DefaultCursor => base.DefaultCursor;
System\Windows\Forms\GroupBoxTests.cs (1)
2305
public new
Cursor
DefaultCursor => base.DefaultCursor;
System\Windows\Forms\HScrollBarTests.cs (1)
254
public new
Cursor
DefaultCursor => base.DefaultCursor;
System\Windows\Forms\LabelTests.cs (1)
889
public new
Cursor
DefaultCursor => base.DefaultCursor;
System\Windows\Forms\ListBoxTests.cs (1)
6412
public new
Cursor
DefaultCursor => base.DefaultCursor;
System\Windows\Forms\ListControlTests.cs (1)
2920
public new
Cursor
DefaultCursor => base.DefaultCursor;
System\Windows\Forms\ListViewItem.IKeyboardToolTipTests.cs (3)
699
Point initialPosition =
Cursor
.Position;
719
Cursor
.Position = position;
724
Cursor
.Position = initialPosition;
System\Windows\Forms\ListViewTests.cs (1)
6107
public new
Cursor
DefaultCursor => base.DefaultCursor;
System\Windows\Forms\MdiControlStripTests.cs (1)
362
public new
Cursor
DefaultCursor => base.DefaultCursor;
System\Windows\Forms\MenuStripTests.cs (1)
858
public new
Cursor
DefaultCursor => base.DefaultCursor;
System\Windows\Forms\MonthCalendarTests.cs (1)
4736
public new
Cursor
DefaultCursor => base.DefaultCursor;
System\Windows\Forms\PanelTests.cs (1)
1162
public new
Cursor
DefaultCursor => base.DefaultCursor;
System\Windows\Forms\PictureBoxTests.cs (1)
2848
public new
Cursor
DefaultCursor => base.DefaultCursor;
System\Windows\Forms\ProgressBarTests.cs (1)
2592
public new
Cursor
DefaultCursor => base.DefaultCursor;
System\Windows\Forms\PropertyGridTests.cs (1)
4185
public new
Cursor
DefaultCursor => base.DefaultCursor;
System\Windows\Forms\RadioButtonTests.cs (1)
1535
public new
Cursor
DefaultCursor => base.DefaultCursor;
System\Windows\Forms\RichTextBoxTests.cs (1)
10932
public new
Cursor
DefaultCursor => base.DefaultCursor;
System\Windows\Forms\ScrollableControlTests.cs (1)
2580
public new
Cursor
DefaultCursor => base.DefaultCursor;
System\Windows\Forms\ScrollBarTests.cs (1)
3168
public new
Cursor
DefaultCursor => base.DefaultCursor;
System\Windows\Forms\SplitterTests.cs (2)
384
public void Splitter_DefaultCursor_GetWithDockStyle_ReturnsExpected(DockStyle dock,
Cursor
expected)
2313
public new
Cursor
DefaultCursor => base.DefaultCursor;
System\Windows\Forms\StatusStripTests.cs (1)
1280
public new
Cursor
DefaultCursor => base.DefaultCursor;
System\Windows\Forms\TabControlTests.cs (1)
5756
public new
Cursor
DefaultCursor => base.DefaultCursor;
System\Windows\Forms\TableLayoutPanelTests.cs (1)
2179
public new
Cursor
DefaultCursor => base.DefaultCursor;
System\Windows\Forms\TabPageTests.cs (1)
5243
public new
Cursor
DefaultCursor => base.DefaultCursor;
System\Windows\Forms\ToolStripContentPanelTests.cs (1)
2024
public new
Cursor
DefaultCursor => base.DefaultCursor;
System\Windows\Forms\ToolStripDropDownTests.cs (1)
5098
public new
Cursor
DefaultCursor => base.DefaultCursor;
System\Windows\Forms\ToolStripPanelTests.cs (1)
367
public new
Cursor
DefaultCursor => base.DefaultCursor;
System\Windows\Forms\ToolStripTests.cs (4)
1333
public void ToolStrip_Cursor_Set_GetReturnsExpected(
Cursor
value)
1362
using
Cursor
cursor1 = new(1);
1373
using
Cursor
cursor2 = new(2);
7503
public new
Cursor
DefaultCursor => base.DefaultCursor;
System\Windows\Forms\TreeNode.IKeyboardToolTipTests.cs (3)
371
Point initialPosition =
Cursor
.Position;
390
Cursor
.Position = position;
395
Cursor
.Position = initialPosition;
System\Windows\Forms\TreeViewTests.cs (1)
7580
public new
Cursor
DefaultCursor => base.DefaultCursor;
System\Windows\Forms\UpDownBaseTests.cs (1)
3113
public new
Cursor
DefaultCursor => base.DefaultCursor;
System\Windows\Forms\UserControlTests.cs (1)
1805
public new
Cursor
DefaultCursor => base.DefaultCursor;
System\Windows\Forms\VScrollBarTests.cs (1)
244
public new
Cursor
DefaultCursor => base.DefaultCursor;
System\Windows\Forms\WebBrowserTests.cs (1)
4674
public new
Cursor
DefaultCursor => base.DefaultCursor;
TextBoxBaseTests.cs (1)
7691
public new
Cursor
DefaultCursor => base.DefaultCursor;
TextBoxTests.cs (1)
689
public new
Cursor
DefaultCursor => base.DefaultCursor;
ToolStripContainerTests.cs (1)
171
var
value = Cursors.Hand;
TrackBarTests.cs (1)
3286
public new
Cursor
DefaultCursor => base.DefaultCursor;
WebBrowserBaseTests.cs (1)
894
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)
650
private
Cursor
? _myNoDropCursor;
651
private
Cursor
? _myNormalCursor;
805
Cursor
.Current = _myNormalCursor;
807
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)
25
private static Dictionary<SWF.
Cursor
, SWI.Cursor> _toSystemWindowsInputCursorDictionary;
26
private static Dictionary<SWF.
Cursor
, SWI.Cursor> ToSystemWindowsInputCursorDictionary
32
_toSystemWindowsInputCursorDictionary = new Dictionary<SWF.
Cursor
, System.Windows.Input.Cursor>();
65
private static Dictionary<SWI.Cursor, SWF.
Cursor
> _toSystemWindowsFormsCursorDictionary;
66
private static Dictionary<SWI.Cursor, SWF.
Cursor
> ToSystemWindowsFormsCursorDictionary
72
_toSystemWindowsFormsCursorDictionary = new Dictionary<SWI.Cursor, SWF.
Cursor
>();
108
internal static SWI.Cursor ToSystemWindowsInputCursor(SWF.
Cursor
swfCursor)
122
internal static SWF.
Cursor
ToSystemWindowsFormsCursor(SWI.Cursor swiCursor)
124
SWF.
Cursor
swfCursor;
System\Windows\Integration\ElementHostPropertyMap.cs (2)
97
SWF.
Cursor
fromCursor = value as SWF.
Cursor
;
System\Windows\Integration\WindowsFormsHost.cs (1)
771
public override
Cursor
Cursor
WinFormsControlsTest (1)
ListViewTest.cs (1)
29
Point pos =
Cursor
.Position;