-
Hello everybody
My mouse cursor turns to a hand over my form. I was just wondering if it was possible to change the mouse cursor again - to another hand, a clenched fist - when the mouse button is pressed over my form.
How would I do this?
It would just be a nice touch like I've seen in other programs - the hand sort of closes its fingers and drags the form around the screen.
Thanks for any help!
-
Use the Form's Mouse Down event.
Cheers,
Paul
P.S. Do not forget to use MouseUp to change it back again...
-
Thanks,
I had an idea it would be like that but...what am I doing wrong?
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Form1.mouseIcon = "c:\windows\desktop\H_move.cur"
End Sub
I get a 'type mismatch' error
Thanks.
-
Errr... Dunno, have you tried MousePointer?
Paul.
-
Mouseicon is a stdpicture, not a string, therefore you get the type mismatch, well i think you just forgot to use loadpicture :)
Form1.mouseIcon = Loadpicture("c:\windows\desktop\H_move.cur")
Set mousepointer to 99, and the icon shows up.
-
This works:
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Form1.MouseIcon = LoadPicture("c:\windows\desktop\H_move.cur")
End Sub
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Form1.MouseIcon = LoadPicture("c:\windows\desktop\H_arrow.cur")
End Sub
But the above means that the user has to have those cursors on their desktop. Is there anyway to include them in my exe or something?
-
place the cursor inside a control property, like picturebox or image. or use a imagelist and it will be compiled with the exe.