Note
This method is supported on Windows only.
public static CursorHandle ToCursorHandle(
this Icon icon,
Point cursorHotspot = default
)
<ExtensionAttribute>
Public Shared Function ToCursorHandle (
icon As Icon,
Optional cursorHotspot As Point = Nothing
) As CursorHandle
public:
[ExtensionAttribute]
static CursorHandle^ ToCursorHandle(
Icon^ icon,
Point cursorHotspot = Point()
)
[<ExtensionAttribute>]
static member ToCursorHandle :
icon : Icon *
?cursorHotspot : Point
(* Defaults:
let _cursorHotspot = defaultArg cursorHotspot new Point()
*)
-> CursorHandle
Though the documentation of the System.Windows.Forms.Cursor class states that it does not support cursors with colors other than black and white, by using this method you can create a cursor that supports colors and partial transparency. Just pass the result CursorHandle to the Cursor(IntPtr) constructor.
PlatformNotSupportedException | This method is supported on Windows only. |