Q: Cursor

  • Thread starter Thread starter Geoff Jones
  • Start date Start date
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
 
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
 
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")
///
 
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
 
You can also embed cursors in your application as an embedded resource
instead of having to drag a cursor file along with your application.
 
Back
Top