Mouse.SetCursor(Cursor) Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Sets the mouse pointer to the specified Cursor.
public:
static bool SetCursor(System::Windows::Input::Cursor ^ cursor);
public static bool SetCursor(System.Windows.Input.Cursor cursor);
static member SetCursor : System.Windows.Input.Cursor -> bool
Public Shared Function SetCursor (cursor As Cursor) As Boolean
- cursor
- Cursor
The cursor to set the mouse pointer to.
true
, if the cursor was set; otherwise, false
.
The cursor being set does not apply to any particular element, but rather it applies to the whole application. So, if after setting the cursor the mouse pointer moves over an object which sets the cursor, the cursor will be changed again.
To force the mouse pointer to a specific Cursor and to force this Cursor on all elements, set the OverrideCursor property.
To set the cursor on a specific element, use the Cursor property on either FrameworkElement or FrameworkContentElement. For more information on the base elements, see the Base Elements Overview.
Product | Versions |
---|---|
.NET Framework | 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9, 10 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: