?
Solved

Tool Tips for ToolBar "drop down" menus

Posted on 2003-03-20
3
Medium Priority
?
159 Views
Last Modified: 2010-04-07
How can I get my drop drown menus to display a Tool Tip utilizing the tooltip property as I highlight them with either my mouse or as I scroll down with the arrows.

The below is for a command button, but I need something for

Label1.Caption = Command1.Tag
Label1.Top = Command1.Top + Command1.Height
Label1.Left = Command1.Left + Command1.Width / 2
Label1.Visible = True
Command1.Tag = "This is the TAG TIP"
Label1.Visible = False


If you need any additiona info, let me know.
0
Comment
Question by:GlobalFax
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 11

Accepted Solution

by:
supunr earned 2000 total points
ID: 8178933
may be this will give you a start.

create a module and put this code...

Option Explicit

Public OldWndProc As Long
Public gWH As Long
Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Declare Function CallWindowProc Lib "user32" Alias "CallWindowProcA" (ByVal lpPrevWndFunc As Long, ByVal hwnd As Long, ByVal Msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long

Public Const GWL_WNDPROC = -4
Const WM_MENUSELECT = &H11F

Function LowOrd(DbleWord As Long) As Integer
    If DbleWord And &H8000& Then
        LowOrd = &H8000 Or (DbleWord And &H7FFF&)
    Else
        LowOrd = DbleWord And &HFFFF&
    End If
End Function

Function WindowProc(ByVal hwnd As Long, ByVal Msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
    On Error Resume Next
   
    Dim X As Long
    Dim MenuText(0 To 75) As String
       
    X = CallWindowProc(OldWndProc, hwnd, Msg, wParam, lParam)
    Select Case Msg
        Case WM_MENUSELECT
            MenuText(0) = ""   '    "&File"
            MenuText(1) = ""   '    "&File"
            MenuText(2) = "Print the products table."   '       "Open"
            MenuText(3) = "Exit the program"   '       "E&xit "

            Dim Index As Long
            Index = (wParam And &H100000) Or LowOrd(wParam)
           
            If (Index >= 0 And Index < 4) Then ' ignore main menus
                Form1.Print MenuText(LowOrd(wParam))
            Else
                Form1.Print ""
            End If
    End Select
   
    WindowProc = X
    On Error GoTo 0
End Function


' Now create a form with File menu and inside that Open and Exit menu options

in the form_load function, put the following code...

Private Sub Form_Load()
    gWH = Me.hwnd
    OldWndProc = SetWindowLong(gWH, GWL_WNDPROC, AddressOf WindowProc)
End Sub

You could play around this code and get it to work the way you want.  I am not sure how you could get a tooltip though.  Only option you could do is show these help messages in a statusbar control of the same form (similar to IE, etc.)

Good Luck!
0
 
LVL 1

Author Comment

by:GlobalFax
ID: 8207472
Answer accepted with a few modifications.

Thanks for your help!
0
 
LVL 1

Author Comment

by:GlobalFax
ID: 8239750
Answer accepted with a few modifications.

Thanks for your help!
0

Featured Post

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month9 days, 15 hours left to enroll

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question