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
Solved

How to display menu help

Posted on 1998-09-24
6
225 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
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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

856 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