Solved

How to display menu help

Posted on 1998-09-24
6
227 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
[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
6 Comments
 
LVL 2

Expert Comment

by:shogi
ID: 1436526
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
ID: 1436527
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
ID: 1436528
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 6

Expert Comment

by:clifABB
ID: 1436529
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
ID: 1436530
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
ID: 1436531
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

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
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…

724 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