Hello,
I want to change the mouse cursor like Hand Cursor (Normally we see this cursor in Web Link) when mouse moves on a label and change back to default when move to form.
Thanks,
I dont want to change the color of button, i want to change the mouse Cursor
First set the label's MousePointer to 99 (custom). And then assingn the the MouseIcon property a cursor/icon file (which can be a 'Hand' as u want).
Pradeep
Pradeep, Microsoft MVP (Visual Basic) Please appreciate posts that have helped you by clicking icon on the left of the post.
"A problem well stated is a problem half solved." — Charles F. Kettering
Thanks,
I dont want to change the color of button, i want to change the mouse Cursor
You said you wanted a different cursor when the mouse was over a label. The method is the same for coloring a button, except for one statemnt to color and another to uncolor. You need the same thing with a change to where it colors the control, to changing the cursor.
Also, put the code from the buttone into coding for the label.
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me.MousePointer = 0
End Sub
Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me.MousePointer = 99
Me.MouseIcon = LoadPicture("C:\Harrow.Cur")
End Sub
You don't need that code to set the hand cursor for a label. The Label itself also have the MousePointer and MouseIcon properties which you can set at design time.