|
-
Oct 2nd, 2000, 04:06 PM
#1
I'm using a picturebox as a custom button and I want to change the mouse pointer while the mouse is down.
MouseMove is great, unless the user moves their cursor off of the control. I want the mouse pointer to be changed no matter where they move... until they release the button.
Any Suggestions?
Thanks,
-Jordan
-
Oct 2nd, 2000, 04:34 PM
#2
Use the MousePointer property of the Picturebox, i.e.
Code:
Option Explicit
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Picture1.MousePointer = vbHourglass
End Sub
Private Sub Picture1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Picture1.MousePointer = vbDefault
End Sub
-
Oct 2nd, 2000, 05:11 PM
#3
Thanks Aaron, how do I do it for a custom icon?
-
Oct 2nd, 2000, 05:22 PM
#4
Set the Picture's MouseIcon to the Icon you desire. And change vbHourGlass to vbCustom.
Code:
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Picture1.MousePointer = vbCustom
End Sub
-
Oct 2nd, 2000, 06:16 PM
#5
Picture1.MousePointer = vbCustom doesnt work.. I'd like to try to get the Custom icon associated with the mouseover on the picture box.. sorta like this:
Picture1.MousePointer = Picture1.MouseIcon
... but that gives me an overflow error.
[Edited by Jordan on 10-02-2000 at 07:35 PM]
-
Oct 2nd, 2000, 07:03 PM
#6
Try this:
Code:
Private Sub Form_Load()
Picture1.MouseIcon = "C:\Icons\MyIcon.ico"
End Sub
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Picture1.MousePointer = vbCustom
End Sub
vbCustom = Picture1.MouseIcon
That should work.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|