Q: Cursor

G

Geoff Jones

Hi

I have added a new cursor that I've designed to an application. However, I
don't know how to use it in the project. I guess I should use something
like:

Me.Cursor = .........my new cursor????

but I don't know where to start. Doesn't seem to be that much in the VS
documentation.

Can anybody help?

Thanks in advance

Geoff
 
G

Guest

Geoff,
Give this a shot...

Dim bm As New Bitmap("c:\myImage.bmp")
Dim ptrCur As IntPtr = bm.GetHicon
Dim cur As Cursor
cur = New Cursor(ptrCur)
Me.Cursor = cur

I hope this helps,
Phil Harvey
 
H

Herfried K. Wagner [MVP]

Geoff Jones said:
I have added a new cursor that I've designed to an application. However, I
don't know how to use it in the project. I guess I should use something
like:

Me.Cursor = .........my new cursor????

\\\
Me.Cursor = New Cursor("C:\foo.cur")
///
 
G

Geoff Jones

Did the trick! Thanks

Phil Harvey said:
Geoff,
Give this a shot...

Dim bm As New Bitmap("c:\myImage.bmp")
Dim ptrCur As IntPtr = bm.GetHicon
Dim cur As Cursor
cur = New Cursor(ptrCur)
Me.Cursor = cur

I hope this helps,
Phil Harvey
 
G

Guest

You can also embed cursors in your application as an embedded resource
instead of having to drag a cursor file along with your application.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top