Re: Custom cursor from file
.Paul. has a CursorCreator class that I have used in the past to create cursors from graphics files. I'll let him pass that on, if he wants. Making animated cursors is a bit weirder, but I have some information on that, if it is of interest.
As for the second part, it can be done, but I'm not quite sure what you want. Changing the cursor on a button click would be a bit weird, as the click tends to happen in short order. Is it supposed to change back or remain the same?
One thing I have done is to change the cursor on MouseOver. I have a crosshairs cursor which is normally black, but changes to red when the cursor is moved across a button that is a viable target for the cursor.
Re: Custom cursor from file
i mean default cursor to be Cursor1, but when you mouseover in textbox it shows | icon, to display Cursor1 again instead | , and Cursor2 is when you click with the mouse to display the effect
i can show images:
Cursor1: default mouse
http://img535.imageshack.us/img535/6775/cursoriy.png
Cursor2: when click with mouse
http://img805.imageshack.us/img805/7996/cursor3.png
Re: Custom cursor from file
i managed to make it, but i got 1 bug on the cursor, how to make it on top of the finger to be the mouse to click , couse now its under the hand?
code:
Code:
Declare Function LoadCursorFromFile Lib "user32" Alias "LoadCursorFromFileA" (ByVal lpFileName As String) As IntPtr
Dim g As IntPtr = LoadCursorFromFile("MyCursor.cur")
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Cursor = New Cursor(g)
End Sub
I made cursor options:
Build Action: Embedded Resource
Copy to. : Copy always
any ideas how to fix it?