Is there a way to use a custom cursor in winforms?
There seems to be no option. But when I try to manually add a cursor as a resource, then call it from code, it says that it cannot convert from type byte[] to Cursor.
Is there a way to use a custom cursor in winforms?
There seems to be no option. But when I try to manually add a cursor as a resource, then call it from code, it says that it cannot convert from type byte[] to Cursor.
From the MSDN documentation on the
Cursor
class (with minor corrections):I've used the
LoadCursorFromFile()
method from User32.dll. There are plenty of samples for this on the web.OR
The ctor for the
Cursor
type also has aIO.Stream
overload. Load yourbyte[]
into aMemoryStream
and feed that to the newCursor
.Adding custom icon to cursor in C# :
Add Icon file to Project resources (ex : Processing.ico)
And in properties window of image switch "Build Action" to "Embedded"
After adding the file to the resources, in the properties window of the image: switch
Build Action
toEmbedded Resource
and write in your code: