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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mouse icon

Status
Not open for further replies.

Mollethewizard

IS-IT--Management
Nov 18, 2002
93
SE
Hello

Is there a way to change the mouse icon to a hand when the user moves the cursor to the OK button in a user form? Is the “function” available in VBA?
And how do I accomplish the change?

Greetings Mollethewizard


 
Use this API code in a module
and call it on MouseMove of the command button
Code:
Private Sub cmdOK_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
MouseCursor (32649)
End Sub

________________________________________________________
Zameer Abdulla
Help to find Missing people
My father was a realistic father; not a vending machine dispense everything I demanded for!!
 
Perhaps even easier is to set the MousePointer property of the control you are interested in (CommandButton in this case). On my system using XL2000 a "hand" icon is not an available choice, but you can also set a custom icon. Choose fmMousePointerCustom in the dropdown box for the MousePointer property then in the Userform Initialize event include something like the following:
Code:
Private Sub UserForm_Initialize()
   CommandButton1.MouseIcon = LoadPicture("C:\WINNT\Cursors\harrow.cur")
End Sub


Regards,
Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top