Hi:
I have a form with a Image control and I want to change the mouse pointer to a custom cursor when the mouse is over that control and return to the default one once it leaves the control. I followed a tip in the MSDN Library (which is incompleted, by the way). In this, using MouseMove and DragOver events and setting the DragIcon property of the Image control to the desired cursor you apparently solve the problem. Something like this:
Private Sub Image1_DragOver(Source As Control, X As Single, Y As Single, State As Integer)
If (State = 1) Then 'They forgot this if to trigger the
'event only when the mouse leave the
'control.
Image1.Drag 0 'turn off the custom cursor
End If
End Sub
Private Sub Image1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Image1.Drag 1 'turn on the custom cursor
End Sub
Like I said this apparently works. But I also want to trigger a click event when the user click over the Image control. Using this approach the click event is not triggered.
Any suggestion...
Thanks in Advance
Alberto
I have a form with a Image control and I want to change the mouse pointer to a custom cursor when the mouse is over that control and return to the default one once it leaves the control. I followed a tip in the MSDN Library (which is incompleted, by the way). In this, using MouseMove and DragOver events and setting the DragIcon property of the Image control to the desired cursor you apparently solve the problem. Something like this:
Private Sub Image1_DragOver(Source As Control, X As Single, Y As Single, State As Integer)
If (State = 1) Then 'They forgot this if to trigger the
'event only when the mouse leave the
'control.
Image1.Drag 0 'turn off the custom cursor
End If
End Sub
Private Sub Image1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Image1.Drag 1 'turn on the custom cursor
End Sub
Like I said this apparently works. But I also want to trigger a click event when the user click over the Image control. Using this approach the click event is not triggered.
Any suggestion...
Thanks in Advance
Alberto