Solved

How to display menu help

Posted on 1998-09-24
6
223 Views
Last Modified: 2010-04-30
VB provides only one menu event i.e. click. I want to show the menu description in the status bar when mouse is moved over a menu item.
Does anybody know how this can be done ?
Thanks
0
Comment
Question by:sgarg
6 Comments
 
LVL 2

Expert Comment

by:shogi
Comment Utility
You just have to call WinHelp for API when you want.

It's very simple to use

Declare Function WinHelp Lib "user32" Alias "WinHelpA" (ByVal hwnd As Long, ByVal lpHelpFile As String, ByVal wCommand As Long, ByVal dwData As Long) As Long


And you call it like

RC = WinHelp (me.hwnd, "MyHelp.hlp", uCommand, dwData )

uCommand
Specifies the type of help requested. For a list of possible values and how they affect the value to place in the dwData parameter.

dwData
Specifies additional data. The value used depends on the value of the uCommand parameter.







0
 

Expert Comment

by:TT
Comment Utility
Instead of calling API function, You can try the mousemove event

Private Sub Toolbar1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
   
    Dim iCnt As Integer
    Dim iIdx As Integer
       
    For iCnt = 1 To 5 // 5 buttons on toolbar
        If X > Toolbar1.Buttons(iCnt).Left And _
           X < Toolbar1.Buttons(iCnt).Left + Toolbar1.Buttons(iCnt).Width And _
           Y > Toolbar1.Buttons(iCnt).Top And _
           Y < Toolbar1.Buttons(iCnt).Top + Toolbar1.Buttons(iCnt).Height Then
            StatusBar1.SimpleText = Toolbar2.Buttons(iCnt).ToolTipText
          Exit For
        End If
    Next
0
 

Expert Comment

by:TT
Comment Utility
Instead of calling API function, You can try the mousemove event

Private Sub Toolbar1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
   
    Dim iCnt As Integer
    Dim iIdx As Integer
       
    For iCnt = 1 To 5 // 5 buttons on toolbar
        If X > Toolbar1.Buttons(iCnt).Left And _
           X < Toolbar1.Buttons(iCnt).Left + Toolbar1.Buttons(iCnt).Width And _
           Y > Toolbar1.Buttons(iCnt).Top And _
           Y < Toolbar1.Buttons(iCnt).Top + Toolbar1.Buttons(iCnt).Height Then
            StatusBar1.SimpleText = Toolbar2.Buttons(iCnt).ToolTipText
          Exit For
        End If
    Next
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 6

Expert Comment

by:clifABB
Comment Utility
If you want to display a message in a statusbar when a menu item is highlighted (the way explorer does), you will have to use subclassing.  To save space (and typeing) Microsoft has an article explaining *exactly* how to accomplish what you want.

Checkout -
HOWTO: Display Descriptions of Menu Items When Highlighted
(Article ID: Q185451)
Located at -
http://support.microsoft.com/support/kb/articles/q185/4/51.asp

0
 

Author Comment

by:sgarg
Comment Utility
I was looking for displaying the menu description in the status bar and MR clifABB has answered the question. How do I give credit to clifABB.

0
 
LVL 6

Accepted Solution

by:
clifABB earned 50 total points
Comment Utility
You do this by grading this answer.  :)

Checkout -
HOWTO: Display Descriptions of Menu Items When Highlighted
(Article ID: Q185451)
Located at -
http://support.microsoft.com/support/kb/articles/q185/4/51.asp

Thanks.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

744 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now