Loading ...
Sorry, an error occurred while loading the content.
 

Problem in getting a tooltip in VS 2005 addin

Expand Messages
  • sumitpkedia
    Hi, I have developed a VS 2005 addin which adds a buttont to toolbar. I have changed the tooltip of button thru AddNamedCommand2(...) call by editing the 4th
    Message 1 of 2 , Jul 11 8:31 AM
      Hi,

      I have developed a VS 2005 addin which adds a buttont to toolbar.

      I have changed the tooltip of button thru "AddNamedCommand2(...)" call
      by editing the 4th parameter.

      But when i hovour on the button i am not able to get the Tooltip as I
      have given in the above call.

      Can anybody help?Its urgent.

      Regards

      Sumeet
    • Pirelli Jean-Marie
      Hi, I had a problem with tooltips in VS 2005 Beta 2 and added some code in my add-in to work around it. I have not removed this code so I don t know if it s
      Message 2 of 2 , Jul 12 7:04 AM
        Hi,

        I had a problem with tooltips in VS 2005 Beta 2 and added some code in
        my add-in to work around it. I have not removed this code so I don't
        know if it's still necessary.
        Anyway, here is the code (this is an extract with lots of stuff removed,
        so don't take the code literally) :

        Dim command As Command = Nothing

        Dim status As vsCommandStatus =
        vsCommandStatus.vsCommandStatusSupported

        ' ci is a structure with some information about a command,
        like its name, tooltip, handler function
        command = commands.AddNamedCommand2(addInInstance, ci.Name,
        _
        ci.Tooltip, ci.Tooltip, True, ci.Handler,
        Nothing, _
        status, vsCommandStyle.vsCommandStylePict, _

        vsCommandControlType.vsCommandControlTypeButton)

        Dim butt As CommandBarButton
        Dim commandBarCtrl As CommandBarControl = Nothing
        Dim newCommandBar As CommandBar = ' get the right command
        bar

        commandBarCtrl = CType(command.AddControl(newCommandBar,
        1), CommandBarControl)

        butt = CType(commandBarCtrl, CommandBarButton)

        ' this property was not reliable in b2
        butt.TooltipText = ci.Tooltip

        Hope this helps,
        Jean-Marie Pirelli


        [Non-text portions of this message have been removed]
      Your message has been successfully submitted and would be delivered to recipients shortly.