[]
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.
Complete the following steps:
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.
Click C1TopicBars smart tag () to open the C1TopicBar Tasks menu.
On the C1TopicBar Tasks menu, click Add Page.
Page 2 is added to the C1TopicBar control.
Complete the following steps:
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.
Click the C1TopicBar control's chevron button to activate the floating toolbar. The floating toolbar will appear on the page as follows:
On the floating toolbar, select the Add topic page button .
Page 2 is added to the C1TopicBar control.
Complete the following steps:
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.
Right-click on the C1TopicBar control to open its context menu.
From the context menu, select Add Page.
Page 2 is added to the C1TopicBar control.
Complete the following steps:
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.
Click C1TopicBar's smart tag () to open the C1TopicBar Tasks menu.
On the C1TopicBar Tasks menu, click Edit Pages.
The C1TopicPage Collection Editor opens.
Click Add to add a page to the collection.
Click OK to close the C1TopicPage Collection Editor.
Page 2 is added to the C1TopicBar control.
Complete the following steps:
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.
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.
Import the following namespace into the project:
To write code in Visual Basic
Imports C1.Win.C1Command
To write code in C#
using C1.Win.C1Command;
Add the following code, which creates the new topic page and adds it to the topic bar, to the Form_Load event:
To write code in Visual Basic
'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)
To write code in C#
//Create new topic page object named "Page 2"
C1TopicPage c1TopicPage2 = new C1TopicPage("Page 2");
//Add new topic page to topic
c1TopicBar1.Pages.Add(c1TopicPage2);
Press F5 to build the project and observe that a new page, named Page 2, appears on the control.
In this topic, you have learned to add a page to the C1TopicBar control using five separate methods. No matter which method you used, the final result of this topic will appear as follows: