Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

Mouse.SetCursor Method

Sets the mouse pointer to the specified Cursor.

Namespace: System.Windows.Input
Assembly: PresentationCore (in presentationcore.dll)

public static bool SetCursor (
	Cursor cursor
)
public static boolean SetCursor (
	Cursor cursor
)
public static function SetCursor (
	cursor : Cursor
) : boolean
You cannot use methods in XAML.

Parameters

cursor

The cursor to set the mouse pointer to.

Return Value

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.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.