Results 1 to 1 of 1

Thread: VB6 - Add "tooltips" to menu items

Threaded View

  1. #1

    Thread Starter
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    VB6 - Add "tooltips" to menu items

    This project demonstrates the display of menu item descriptions when a menu item is highlighted. It uses message hooking.

    Note: If you have accelerators (eg. & ) in your menu text and/or shortcuts (eg. Ctrl+N) then the GetDescription function in the app needs to be modified as shown below.

    VB Code:
    1. Private Function GetDescription(MenuCaption As String) As String
    2.     'Determine the description of the menu item.
    3.        
    4.     Select Case MenuCaption
    5.         Case "[b]&New" & vbTab & "Ctrl+N[/b]"
    6.             GetDescription = "Creates a new document"
    7.         Case "Open"
    8.             GetDescription = "Opens a Document"
    9.         Case "Close"
    10.             GetDescription = "Closes Document"
    11.         Case "Cut"
    12.             GetDescription = "Cuts Selection to Clipboard"
    13.         Case "Copy"
    14.             GetDescription = "Copies Selection to Clipboard"
    15.         Case "Paste"
    16.             GetDescription = "Pastes Contents of Clipboard"
    17.         Case "Normal"
    18.             GetDescription = "Regular Paste"
    19.         Case "Special"
    20.             GetDescription = "Special Paste"
    21.         Case Else
    22.             GetDescription = ""
    23.     End Select
    24. End Function
    Attached Files Attached Files

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