ComponentOne Menus and Toolbars for WinForms
Adding a OutPage to the OutBar
Menus and Toolbars for WinForms Task-Based Help > OutBar Tasks > Adding a OutPage to the OutBar

To programmatically add a new C1OutPage to the C1OutBar, complete the following steps:

  1. Add the C1OutBar control to the form.
  2. Import the C1.Win.C1Command namespace. The code below imports the C1.Win.C1Command namespace.

    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;
    
  3. Add a new C1OutPage to the C1OutBar. The last line of code uses the Add method to add the new outpage1 to the C1OutBar1. Enter the following code within the Form_Load event:

    To write code in Visual Basic

    Visual Basic
    Copy Code
    Dim outpage1 As New C1.Win.C1Command.C1OutPage()
    Outpage1.Text = "New Page"
    Me.c1OutBar1.Pages.Add(outpage1)
    

    To write code in C#

    C#
    Copy Code
    C1.Win.C1Command.C1OutPage outpage1 = new C1.Win.C1Command.C1OutPage();
    outpage1.Text = "New Page";
    this.c1OutBar1.Pages.Add(outpage1);
    
  4. Build and run the new page you created for C1OutBar. The new out page appears like the following image.
See Also