Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hand cursor/icon like with Internet Explorer hyperlink
Hi all
I have found an alternative solution to the problem of a suitable cursor to emulate a hyperlink. I have a label with a Click event, and I want the cursor to look like the hand over a hyperlink in Internet Explorer. I've tried the hyperlink cursor solution provided by John Walkenbach and others, but I don't really like the cursor image (nor have I been able to find one I like). I found another solution on Google that others might find useful, because the cursor appears to be the IE cursor. The first block of code goes into a module: Public Declare Function LoadCursor Lib "user32" Alias "LoadCursorA" _ (ByVal hInstance As Long, ByVal lpCursorName As Long) As Long Public Declare Function SetCursor Lib "user32" _ (ByVal hCursor As Long) As Long Public Const IDC_HAND = 32649& Public Const IDC_ARROW = 32512& Public Sub SetHandCur(Hand As Boolean) If Hand = True Then SetCursor LoadCursor(0, IDC_HAND) Else SetCursor LoadCursor(0, IDC_ARROW) End If End Sub __________________________________________________ _______ Then, on the UserForm for the label (or relevant control) MouseMove and MouseDown events: SetHandCur True When the cursor is over the control, the cursor changes, and using the MouseDown event ensures that the cursor does not revert to default when clicking a mouse button. Regards Paul Martin Melbourne, Australia |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hand cursor/icon like with Internet Explorer hyperlink
PS The original posting may be found at:
<http://groups.google.com.au/group/microsoft.public.vb.syntax/msg/7675b4d391cc386c?hl=en I have modified the code as follows: Public Sub SetHandCursor(bUseHandA As Boolean) Dim lCursor As Long lCursor = IIf(bUseHandA = True, IDC_HAND, IDC_ARROW) SetCursor LoadCursor(0, lCursor) End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Why does Internet Explorer open a jpeg from a hyperlink ??? | Excel Discussion (Misc queries) | |||
Why does Internet Explorer open a jpeg from a hyperlink ??? | Excel Discussion (Misc queries) | |||
Internet Explorer opens jpeg from a hyperlink ??? | Excel Worksheet Functions | |||
Hyperlink to a .gif opens with Internet Explorer | Excel Discussion (Misc queries) | |||
Hyperlink from Internet Explorer to Excel | Excel Discussion (Misc queries) |