Results 1 to 3 of 3

Thread: Classic VB - How can I show the 'link select' (hyperlink) mouse cursor?

Threaded View

  1. #1

    Thread Starter
    Frenzied Member I_Love_My_Vans's Avatar
    Join Date
    Jan 2005
    Location
    In the PHP compiler
    Posts
    1,275

    Classic VB - How can I show the 'link select' (hyperlink) mouse cursor?

    Within the VB6 IDE you can very easily change the mouse pointer, and there are many different choices you have with this.

    Some applications have links to internet based resources such as websites; however VB6 does not have the option to change the mouse pointer to the link select cursor (that’s the hyperlink hand).

    Developers should not rely on the standard arrow pointer as this doesn’t highlight the fact that there is a link present.

    To fix this many developers opt for the "Custom Mouse Pointer" option, adding an image that will look like the link select mouse pointer.

    The mouse pointer may look sufficient on the machine it’s being developed on, but what about when it is distributed? Other users may have different themes, and a big example of this is Windows Vista. The link select mouse pointer is slightly improved; using shadows to make it more realistic, if that’s even possible, having the old style black and white hand icon will make your application look out of place, negating the end users theme.

    The solution is even simpler than having a custom image, just use the code below.

    VB Code:
    1. Option Explicit
    2.  
    3. Private Const IDC_HAND = 32649&
    4. Private Const IDC_ARROW = 32512&
    5. Private Declare Function LoadCursor Lib "user32" Alias "LoadCursorA" (ByVal _
    6.     hInstance As Long, ByVal lpCursorName As Long) As Long
    7. Private Declare Function SetCursor Lib "user32" (ByVal hCursor As Long) As Long
    8.    
    9. Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, _
    10.     Y As Single)
    11.     SetCursor LoadCursor(0, IDC_HAND)
    12. End Sub

    The code above was shown in RhinoBulls post back in 2006, and shows an easier method of invoking the Link Select cursor.


    I Love My Vans
    Last edited by I_Love_My_Vans; Mar 4th, 2007 at 05:17 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width