ComponentOne Ribbon for WinForms
C1Ribbon (Classic) Quick Start / Step 1 of 7: Add Controls to the Windows Form and Create the Ribbon Form
In This Topic
    Step 1 of 7: Add Controls to the Windows Form and Create the Ribbon Form
    In This Topic

    To begin, create a Visual Studio WinForms project and add the C1Ribbon and C1StatusBar controls to your application. For more information on creating a new project, see Creating a .NET Project.

    To set up your new Ribbon Form, follow these steps:

    1. Add the C1Ribbon control to the Ribbon Form:
      From the Toolbox, double-click the C1Ribbon control to add it to your form. The Ribbon docks at the top of the Ribbon form.
    2. Add the C1StatusBar control to the Ribbon Form:
      From the Toolbox, double-click the C1StatusBar control to add it to your form. The status bar docks at the bottom of the Ribbon Form.
    3. Add the RichTextBox control to the Ribbon Form:
      1. From the Toolbox, double-click the RichTextBox control to add it to your form.
      2. From the Properties window, set the RichTextBox1.Dock property to Fill.
    4. Create a Ribbon Form:
      Change the Windows Form to a Ribbon Form by modifying the code that declares your form:
      In Visual Basic Language:
      1. From the Solution Explorer, click the Show All Files button in the toolbar.
      2. From the Solution Explorer window, expand the Form1.vb node to reveal the Form's Designer.
        Solution Explorer window with Form Designer node
      3. Double­-click Form1.Designer.vb to open the Code Editor.

      In C# Language:
      To open the Code Editor, right-click the Windows Form and select View Code.

      Continue in all Languages:
      In the Code Editor, replace the following:

      To write code in Visual Basic

      Visual Basic
      Copy Code
      Partial Class Form1
          Inherits System.Windows.Forms.Form
          '...
      End Class
      

      To write code in C#

      C#
      Copy Code
      partial class Form1 : Form {
          //...
      }
      

      With

      To write code in Visual Basic

      Visual Basic
      Copy Code
      Partial Class Form1
          Inherits C1.Win.C1Ribbon.C1RibbonForm
          '...
      End Class
      

      To write code in C#

      C#
      Copy Code
      partial class Form1 : C1.Win.C1Ribbon.C1RibbonForm {
         //...
      }
      

    Run you application and observe:

    You have successfully added the C1Ribbon, C1StatusBar, and RichTextBox controls to your project and created a Ribbon Form:


    Ribbon form created using C1Ribbon, C1StatusBar and RichTextBox

    In the next step you will add Ribbon items to the Ribbon.