User Defined Cursor for a UserControl

MatP

Newcomer
Joined
Oct 12, 2004
Messages
11
I've created a new UserControl, in my project I added a new cursor file, and draw it myself.

Now, I would like the cursor to be added in the DLL file when my project is compiled. And, I want to be able in my UserControl to refer to the cursor that I added in the project, not to the filepath of the cursor wich would mean I must distribute the DLL file AND the Cursor File...

a kind of:
myCursor = Cursors.LoadFromThisProject("myCursor.cur")
and not
myCursor = New Cursor(Application.StartupPath & "\myCursor.cur")
because this one tells me, when I try to add my control to a form, that it couldn't find "C:\program files\Microsoft Visual Studio .Net 2003\common7\IDE\mycursor.cur" file.

I tried adding an imageList then adding Cursor files, but it doesn't seem to work like the ICO file. I can't add .CUR file to the imagelist.

Thanks for the help,
 
You probably need to make it an embedded resource that is compiled into the dll and then use the resource manager to access it.
 
Back
Top