0

I am trying to change the mouse pointer to a .png image on mouse hover over a panel, but didn't achieve success as yet. Any suggestions?

Here is what I have tried so far:

Cursor myCursor = new Cursor("pic1.png");
myControl.Cursor = myCursor;
1

1 Answer 1

3

You need to make the image, a .cur file and then add the cursor file as a project resource.

Follow this step:

  1. Goto Project Properties->Resource tab.

  2. Click arrow on the "Add Resource" button, and add your .cur file

In your code you can use it like:

Dim memstrm As New System.IO.MemoryStream(My.Resources.CustomCursor)
YourButton.Cursor = New Cursor(memstrm)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.