locked
How to add ToolTipText to a OleMenuCommand? RRS feed

  • Question

  • How to add a ToolTipText to a OleMenuCommand?

    Thursday, August 5, 2010 7:37 AM

Answers

  • Hi,

    As far I as have researched, we are not able add tooltip to the menu command, if you look through all the menu command in IDE, you will find no of them shows a tooltip.

     

    But a button in toolbar could have tooltip, there is a ToolTipText element in the button which you could set the text.

    See the following

     

          <Button guid="guidVSIPIDEToolbarCmdSet" id="cmdidTestCmd" priority="0x0100" type="Button">

            <Parent guid="guidVSIPIDEToolbarCmdSet" id="ToolbarGroup" />

            <Icon guid="guidImages" id="bmpPic1" />

            <Strings>

              <CommandName>cmdidTestCmd</CommandName>

              <ButtonText>Toolbar Test Command</ButtonText>

              <ToolTipText>Hello, tooltip</ToolTipText>

            </Strings>

          </Button>

     

    But if the ToolTipText is blank, the ButtonText will shows as the tooltip.

    PS: if you want your tooltip text could be changed dynamically, you should just used ButtonText, and leave the tooltipText blank.  To change the tooltip text, you just need to change the ButtonText, about how to change the button text dynamically, see this link.

    http://social.msdn.microsoft.com/Forums/en-US/vsx/thread/e8c9418f-99a8-41d7-bb85-a7db15664abf

    Or you could use OleMenuCommand.Text to change it.

    Thanks

    Chao


    Please unmark it if it does not help, and mark it if it helps.
    • Marked as answer by Chao Kuo Thursday, August 12, 2010 2:34 AM
    Monday, August 9, 2010 7:49 AM