ComponentOne Menus and Toolbars for WinForms
Menus and Toolbars for WinForms Task-Based Help / TopicBar Tasks / Using Topic Bar ToolTips / Adding ToolTips to Topic Pages
In This Topic
    Adding ToolTips to Topic Pages
    In This Topic

    You can add ToolTips to topic pages using the floating toolbar, the collection editor, and code.

    Using the Floating Toolbar

    Complete the following steps:

    1. Navigate to the Toolbox and double-click the C1TopicBar icon. The C1TopicBar control is added to the form. Observe that one page, named Page 1, appears on the control by default. If you'd like to add more pages to the control, see Adding Topic Pages to the TopicBar.
    2. Hover over Page1 (or another page of your choice) with your cursor until the floating toolbar appears. The topic page's toolbar appears as follows:
      Floating toolbar
    3. Click the Edit topic page appearance button Button to open the C1TopicPage Properties editor.
    4. In the Tooltip text box, enter “I am a topic page ToolTip!”.
    5. Press F5 to build the project.
    6. Hover over the page you added the ToolTip to and observe that a ToolTip appears.

    Using the Collection Editor

    Complete the following steps:

    1. Navigate to the Toolbox and double-click the C1TopicBar icon. The C1TopicBar control is added to the form. Observe that one page, named Page 1, appears on the control by default. If you'd like to add more pages to the control, see Adding Topic Pages to the TopicBar.
    2. Click C1TopicBar's smart tag (Icon) to open the C1TopicBar Tasks menu.
    3. On the C1TopicBar Tasks menu, click Edit Pages.
      Edit Pages
      The C1TopicPage Collection Editor opens.
    4. In the Members pane, select the page you wish to add the ToolTip to.
    5. In the Properties grid, set the ToolTipText property to “I am a topic page ToolTip!”.
    6. Click OK to close the C1TopicPage Collection Editor.
    7. Press F5 to build the project.
    8. Hover over the page you added the ToolTip to and observe that a ToolTip appears.

    Using Code

    Complete the following steps:

    1. Navigate to the Toolbox and double-click the C1TopicBar icon. The C1TopicBar control is added to the form. Observe that one page, named Page 1, appears on the control by default. If you'd like to add more pages to the control, see Adding Topic Pages to the TopicBar.
    2. Click C1TopicBar's smart tag (Icon) to open the C1TopicBar Tasks menu.
    3. On the C1TopicBar Tasks menu, click Edit Pages.
      Edit Pages
      The C1TopicPage Collection Editor opens.
    4. In the Members pane, select the page you wish to dynamically add the ToolTip to.
    5. In the Properties grid, set the Tag property to “PageWithToolTip”. In a later step, you will use this tag to find the topic page.
    6. Click OK to close the C1TopicPage Collection Editor.
    7. Double-click the empty portion of the form to open Code view. Notice that a Form_Load event handler has been added to Code view.
    8. Import the following namespace into the project:

      To write code in Visual Basic

      Visual Basic
      Copy Code
      Imports C1.Win.C1Command
      

      To write code in C#

      C#
      Copy Code
      using C1.Win.C1Command;
      
    9. Add the following code to the Form_Load event. This code will find the page, assign it to a variable, and then set the page's ToolTipText property.

      To write code in Visual Basic

      Visual Basic
      Copy Code
      Dim c1TopicPage1 = c1TopicBar1.FindPageByTag("PageWithToolTip")
      c1TopicPage1.ToolTipText = "I am a topic page ToolTip!"
      

      To write code in C#

      C#
      Copy Code
      var c1TopicPage1 = c1TopicBar1.FindPageByTag("PageWithToolTip");
      c1TopicPage1.ToolTipText = "I am a topic page ToolTip!";
      
    10. Press F5 to build the project.
    11. Hover over the page you added the ToolTip to and observe that a ToolTip appears.

    This topic illustrates the following:

    In this topic, you learned how to add a ToolTip to a topic page using the floating toolbar, the collection editor, and code. No matter which method you used in this topic, the result will resemble the following:


    Tooltip in window
    See Also