locked
Is it possible to create a custom ContentControl tooltip RRS feed

  • Question

  • I wonder if there is a way to create a tooltip for ContentControl. Thanks.
    Monday, October 18, 2010 2:46 PM

Answers

  • Hi feg

    No, not really... About the only thing would be to create a Comment object for the content control range (or a part of it).

    If the text you want to provide is relatively short (max 64 characters), you could assign it to the control's Title property. It will then show up in a blue bar across the top of the content control when the user clicks in it.

    another possibility (if we're talking VSTO Add-in, especially) would be to use a Custom Task Pane to display text when a content control is entered/exited.


    Cindy Meister, VSTO/Word MVP
    • Marked as answer by feg2008 Tuesday, October 19, 2010 12:45 PM
    Monday, October 18, 2010 2:50 PM
  • Yet another possibility would be to use the ContentControlOnEnter event handler in the ThisDocument module to write to the status bar. This isn't as obvious as a tooltip, and the cursor has to actually enter the content control rather than just hover the mouse over it, but the code can be really simple -- something like this:

    Private Sub Document_ContentControlOnEnter(ByVal ContentControl As ContentControl)
        Application.StatusBar = "You entered " & ContentControl.Tag
    End Sub


    Jay Freedman
    MS Word MVP  FAQ: http://word.mvps.org
    • Marked as answer by feg2008 Tuesday, October 19, 2010 12:45 PM
    Monday, October 18, 2010 7:29 PM

All replies

  • Hi feg

    No, not really... About the only thing would be to create a Comment object for the content control range (or a part of it).

    If the text you want to provide is relatively short (max 64 characters), you could assign it to the control's Title property. It will then show up in a blue bar across the top of the content control when the user clicks in it.

    another possibility (if we're talking VSTO Add-in, especially) would be to use a Custom Task Pane to display text when a content control is entered/exited.


    Cindy Meister, VSTO/Word MVP
    • Marked as answer by feg2008 Tuesday, October 19, 2010 12:45 PM
    Monday, October 18, 2010 2:50 PM
  • Yet another possibility would be to use the ContentControlOnEnter event handler in the ThisDocument module to write to the status bar. This isn't as obvious as a tooltip, and the cursor has to actually enter the content control rather than just hover the mouse over it, but the code can be really simple -- something like this:

    Private Sub Document_ContentControlOnEnter(ByVal ContentControl As ContentControl)
        Application.StatusBar = "You entered " & ContentControl.Tag
    End Sub


    Jay Freedman
    MS Word MVP  FAQ: http://word.mvps.org
    • Marked as answer by feg2008 Tuesday, October 19, 2010 12:45 PM
    Monday, October 18, 2010 7:29 PM
  • Thank you guys for your suggestions. Using Title property of ContentControl looks more appropriate in my application at this point.
    Tuesday, October 19, 2010 12:49 PM