Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing MousePointer over Button 2

Status
Not open for further replies.

innmedia

Programmer
Mar 24, 2000
108
US
Hi,

I have a Stop button on a form that I use to let the user cancel processing during a long operation. Clicking it simply sets a global variable flag that process checks during looping. That all works fine.

The problem is that I set the mouse pointer to hourglass during processing. I want the mouse to revert to the default when it is over the Stop button. So, it should be the hourglass anywhere on the form, except when over the button. That lets the user know that they can click the Stop button. It would work either way, but this is nice for the user to see the pointer change.

I tried the MouseOver event of the button but that did not seem to work. Anyone know how to accomplish this?

Thanks!
 
Button with mouseover event in VB 5 or 6?

You could do it on mouse move and check the position is within your button object.

Or you could sub class the button and capture the wm_ event for mouse move.
 
You need to set the mouse pointer of the command button as well. Place a command button on a blank form and test this code.
___
[tt]
Private Sub Form_Load()
Me.MousePointer = vbHourglass
Command1.MousePointer = vbArrow
End Sub[/tt]
___

It works just like the way you want.
 
VBrit and Hypetia,

Thanks for the suggestions! Problem solved.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top