# Adding Topic Pages to the TopicBar

Get started with Menus and Toolbars for WinForms. Create versatile menus and docking/floating toolbars. See more in documentation here.

## Content



There are five ways to add a page to the topic bar: you can use the smart tag, the floating toolbar, the context menu, the collection editor, or code. In this topic, you will learn how to add pages to the topic bar using each of these five methods.

### Using the Smart Tag

Complete the following steps:

1.  Navigate to the Toolbox and double-click the [C1TopicBar](/componentone/docs/win/online-menus-toolbar/) icon. The [C1TopicBar](/componentone/docs/win/online-menus-toolbar/) control is added to the form. Observe that one page, named **Page 1**, appears on the control by default.
2.  Click [C1TopicBar](/componentone/docs/win/online-menus-toolbar/)s smart tag (![smart tag](https://cdn.mescius.io/document-site-files/images/a27cb622-e6d9-4efc-a0b0-0c31245fd632/imagesext/image10_47.png)) to open the **C1TopicBar Tasks** menu.
3.  On the **C1TopicBar Tasks** menu, click **Add Page**.
    
    ![TopicBar Tasks menu](https://cdn.mescius.io/document-site-files/images/a27cb622-e6d9-4efc-a0b0-0c31245fd632/imagesext/image10_62.png)
    
    **Page 2** is added to the [C1TopicBar](/componentone/docs/win/online-menus-toolbar/) control.
    

### Using the Floating Toolbar

Complete the following steps:

1.  Navigate to the Toolbox and double-click the [C1TopicBar](/componentone/docs/win/online-menus-toolbar/) icon. The [C1TopicBar](/componentone/docs/win/online-menus-toolbar/) control is added to the form. Observe that one page, named **Page 1**, appears on the control by default.
2.  Click the [C1TopicBar](/componentone/docs/win/online-menus-toolbar/) control's chevron button ![](https://cdn.mescius.io/document-site-files/images/a27cb622-e6d9-4efc-a0b0-0c31245fd632/imagesext/image10_63.png) to activate the floating toolbar. The floating toolbar will appear on the page as follows:<br />![toolbar](https://cdn.mescius.io/document-site-files/images/a27cb622-e6d9-4efc-a0b0-0c31245fd632/imagesext/image10_64.png)
3.  On the floating toolbar, select the **Add topic page** button ![Floating toolbar](https://cdn.mescius.io/document-site-files/images/a27cb622-e6d9-4efc-a0b0-0c31245fd632/imagesext/image10_65.png) .
    
    **Page 2** is added to the [C1TopicBar](/componentone/docs/win/online-menus-toolbar/) control.
    

### Using the Context Menu

Complete the following steps:

1.  Navigate to the Toolbox and double-click the [C1TopicBar](/componentone/docs/win/online-menus-toolbar/) icon. The [C1TopicBar](/componentone/docs/win/online-menus-toolbar/) control is added to the form. Observe that one page, named **Page 1**, appears on the control by default.
2.  Right-click on the [C1TopicBar](/componentone/docs/win/online-menus-toolbar/) control to open its context menu.
3.  From the context menu, select **Add Page**.
    
    ![Context menu](https://cdn.mescius.io/document-site-files/images/a27cb622-e6d9-4efc-a0b0-0c31245fd632/imagesext/image10_66.png)
    
    **Page 2** is added to the [C1TopicBar](/componentone/docs/win/online-menus-toolbar/) control.
    

### Using the Collection Editor

Complete the following steps:

1.  Navigate to the Toolbox and double-click the [C1TopicBar](/componentone/docs/win/online-menus-toolbar/) icon. The [C1TopicBar](/componentone/docs/win/online-menus-toolbar/) control is added to the form. Observe that one page, named **Page 1**, appears on the control by default.
2.  Click [C1TopicBar](/componentone/docs/win/online-menus-toolbar/)'s smart tag (![Smart tag](https://cdn.mescius.io/document-site-files/images/a27cb622-e6d9-4efc-a0b0-0c31245fd632/imagesext/image10_47.png)) to open the **C1TopicBar Tasks** menu.
3.  On the **C1TopicBar Tasks** menu, click **Edit Pages**.<br />![Edit Pages](https://cdn.mescius.io/document-site-files/images/a27cb622-e6d9-4efc-a0b0-0c31245fd632/imagesext/image10_67.png)<br />The **C1TopicPage Collection Editor** opens.
4.  Click **Add** to add a page to the collection.
5.  Click **OK** to close the **C1TopicPage Collection Editor**.
    
    **Page 2** is added to the [C1TopicBar](/componentone/docs/win/online-menus-toolbar/) control.
    

### Using Code

Complete the following steps:

1.  Navigate to the Toolbox and double-click the [C1TopicBar](/componentone/docs/win/online-menus-toolbar/) icon. The [C1TopicBar](/componentone/docs/win/online-menus-toolbar/) control is added to the form. Observe that one page, named **Page 1**, appears on the control by default.
2.  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.
3.  Import the following namespace into the project:
    
    DOC-DETAILS-TAG-OPEN
    
    DOC-SUMMARY-TAG-OPEN
    
    To write code in Visual Basic
    
    DOC-SUMMARY-TAG-CLOSE
    
    ```vbnet
    Imports C1.Win.C1Command
    ```
    
    DOC-DETAILS-TAG-CLOSE
    
    DOC-DETAILS-TAG-OPEN
    
    DOC-SUMMARY-TAG-OPEN
    
    To write code in C#
    
    DOC-SUMMARY-TAG-CLOSE
    
    ```csharp
    using C1.Win.C1Command;
    ```
    
    DOC-DETAILS-TAG-CLOSE
    
4.  Add the following code, which creates the new topic page and adds it to the topic bar, to the **Form\_Load** event:
    
    DOC-DETAILS-TAG-OPEN
    
    DOC-SUMMARY-TAG-OPEN
    
    To write code in Visual Basic
    
    DOC-SUMMARY-TAG-CLOSE
    
    ```vbnet
    'Create new topic page object named "Page 2"
    Dim c1TopicPage2 As New C1TopicPage("Page 2")
    'Add new topic page to topic
    c1TopicBar1.Pages.Add(c1TopicPage2)
    ```
    
    DOC-DETAILS-TAG-CLOSE
    
    DOC-DETAILS-TAG-OPEN
    
    DOC-SUMMARY-TAG-OPEN
    
    To write code in C#
    
    DOC-SUMMARY-TAG-CLOSE
    
    ```csharp
    //Create new topic page object named "Page 2"
    C1TopicPage c1TopicPage2 = new C1TopicPage("Page 2");
    //Add new topic page to topic 
    c1TopicBar1.Pages.Add(c1TopicPage2);
    ```
    
    DOC-DETAILS-TAG-CLOSE
    
5.  Press F5 to build the project and observe that a new page, named **Page 2**, appears on the control.

### This topic illustrates the following:

In this topic, you have learned to add a page to the [C1TopicBar](/componentone/docs/win/online-menus-toolbar/) control using five separate methods. No matter which method you used, the final result of this topic will appear as follows:

<br />![Page buttons](https://cdn.mescius.io/document-site-files/images/a27cb622-e6d9-4efc-a0b0-0c31245fd632/imagesext/image10_68.png)

## See Also

[Removing a Topic Page from the TopicBar](/componentone/docs/win/online-menus-toolbar/menusandtoolbarsforw2/topicbartasks/addingandremovingtop/removingatopicpagefr)