I know you can set the MouseIcon and MousePointer properties, but I don't want to do that.
Someone (I think RhinoBull?) posted some code using API to automatically show that hand pointer when the mouse hovers over a control. That's what I need.
Printable View
I know you can set the MouseIcon and MousePointer properties, but I don't want to do that.
Someone (I think RhinoBull?) posted some code using API to automatically show that hand pointer when the mouse hovers over a control. That's what I need.
You don't need an API to do that. You can simply put your mouse cursor change code in a Mouse_Move event for the controls in question. All the cursors/icons are in your vb directory including h_point.cur. The MousePointer property also has to be set or coded to (99) Custom.Quote:
Originally Posted by DigiRev
I don't think the hand is there.Quote:
Originally Posted by CDRIVE
I'm trying to do it without using a MouseIcon. I want the standard "white hand" that you see when hovering over a hyperlink, for example.
I remember the code I saw used the MouseMove event but it didn't require setting any of the MousePointer or MouseIcon properties.
Hi,Quote:
Originally Posted by DigiRev
If you use API, you'll always have the current system pointer, here's the code:
HTHCode:' General declaration section
Private Const IDC_HAND = 32649&
Private Const IDC_ARROW = 32512&
Private Const IDC_WAIT = 32514&
Private Declare Function LoadCursor Lib "user32" Alias "LoadCursorA" (ByVal _
hInstance As Long, ByVal lpCursorName As Long) As Long
Private Declare Function SetCursor Lib "user32" (ByVal hCursor As Long) As Long
' MouseOver event where you want the hand...
SetCursor LoadCursor(0, IDC_HAND)
Now that you mention it, I have it there because I used it so often for Mouse_Move events that I probably copied it from my Sys files. ;)Quote:
Originally Posted by jmsrickland
Jottum, that's exactly what I was looking for, thanks. :cool:
Code:Option Explicit
' General declaration section
Private Const IDC_HAND = 32649&
Private Const IDC_ARROW = 32512&
Private Const IDC_WAIT = 32514&
Private Declare Function LoadCursor Lib "user32" Alias "LoadCursorA" (ByVal _
hInstance As Long, ByVal lpCursorName As Long) As Long
Private Declare Function SetCursor Lib "user32" (ByVal hCursor As Long) As Long
Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
SetCursor LoadCursor(0, IDC_HAND)
End Sub
That is nice. I'm going back to all my applications where I loaded an icon from the folder and change them to that method.
Yes, it certainly is! I like this a heck of a lot better than calling the icon from a folder. Do you have any more Hex values for other icons, or can you point us to where to find those values? :thumb: :thumb:Quote:
Originally Posted by jmsrickland
These are the IDC constants from the API viewer that comes with VB6:Quote:
Originally Posted by CDRIVE
Code:Private Const IDC_APPSTARTING = 32650&
Private Const IDC_ARROW = 32512&
Private Const IDC_CROSS = 32515&
Private Const IDC_IBEAM = 32513&
Private Const IDC_ICON = 32641&
Private Const IDC_NO = 32648&
Private Const IDC_SIZE = 32640&
Private Const IDC_SIZEALL = 32646&
Private Const IDC_SIZENESW = 32643&
Private Const IDC_SIZENS = 32645&
Private Const IDC_SIZENWSE = 32642&
Private Const IDC_SIZEWE = 32644&
Private Const IDC_UPARROW = 32516&
Private Const IDC_WAIT = 32514&
I wonder if it is possible to create your own custom made ones and somehow add them to this list giving them some IDC_MYCUSTOMTHING = nnnnnnn
DigiRev, thank you for the constants. I'll take a tour through the viewer.Quote:
Originally Posted by DigiRev
http://allapi.mentalis.org/apilist/L...FromFile.shtmlQuote:
Originally Posted by jmsrickland
[...]Quote:
Originally Posted by DigiRev
You're welcome! :)
thanks Jottum