Creating the project and controls

In this first step, an application is created and Text Control is connected with a ribbon bar and ribbon tabs.

  1. Start Visual Studio .NET and create a new project. Select either Visual Basic or C# as a project type, and Windows Forms Application as a template.

    image

  2. Find the TX Text Control 25.0 toolbox tab that has been created automatically by the TX Text Control setup program. All usable TX Text Control controls and components are listed in this tab.

    image

  3. Click on the TextControl icon and draw it on a form.

    image

  4. Click on the Smart Tag (little right-facing arrow) in the upper right corner of TextControl. In the Wizards group, click on Add a Ribbon, Add a Status Bar, Add a Ruler and Add a Vertical Ruler. Do not insert a ButtonBar. Finally, click on Arrange Controls Automatically. The controls are now connected and docked to fill the container:

    image

  5. On the form, select the ribbon control by clicking the blue File tab title in order to click on the Smart Tag in the upper right corner of the ribbon control. Click on Add a RibbonFormattingTab, Add a RibbonInsertTab, Add a RibbonPageLayoutTab, Add a RibbonViewTab, Add a RibbonProofingTab and Add a RibbonReportingTab.

    image

  6. Build and start the application to see first results.

    image

Adding Contextual Ribbon Tabs

In this step, contextual ribbon tabs for table and frame layout tasks are added and connected.

  1. On the form, select the ribbon control by clicking the blue File tab title in order to click on the Smart Tag in the upper right corner of the ribbon control. Click on Add a Quick Access Toolbar to convert the form to a Windows.Forms.Ribbon.RibbonForm.

  2. Select again the ribbon control by clicking the blue File tab title and find the ContextualTabGroups property in the Properties window.

    image

  3. Open the ContextualTabGroup Collection Editor by clicking on the ellipsis button in the (Collection) value column of the ContextualTabGroups property.

  4. In the Collection Editor, click on Add to add a new Windows.Forms.Ribbon.ContextualTabGroup. Name this group m_grpTableTools, set the Header property to Table Tools and pick a BackColor.

    image

  5. Find the ContextualTabs property in the m_grpTableTools properties and click on the ellipsis button in the (Collection) value column to open the RibbonTab Collection Editor.

    Open the Add drop-down button and click the RibbonTableLayoutTab item.

    image

    Close the dialog by clicking OK.

  6. Repeat step 4 and name this new group m_grpFrameTools, set the Header property to Frame Tools and pick another BackColor.

  7. Find the ContextualTabs property and click on the ellipsis button in the (Collection) value column to open the RibbonTab Collection Editor. Like in step 5, open the Add drop-down button and click the RibbonFrameLayoutTab item and close the dialog by clicking OK.

  8. In the Solution Explorer, select the form Form1 and choose Code from the View main menu. Add the following code, so that the complete Form1 class code looks like this:

    Loading...
    Loading...
  9. Build and start the application.

    Insert a table using the Table drop-down wizard in the Insert ribbon tab. Set the input position into the table to see the contextual Table Tools tab.

    image

Adding an Application Menu

  1. In the Solution Explorer, select the form Form1 and choose Designer from the View main menu.

  2. Select the ribbon control and find the ApplicationMenuItems property in the Properties window.

    image

  3. Open the Control Collection Editor by clicking on the ellipsis button in the (Collection) value column of the ApplicationMenuItems property.

  4. In the Control Collection Editor, click on Add to add a new Windows.Forms.Ribbon.RibbonButton. Name this button m_rbtnLoad and set the Text property to Load.... Add a second button with the name m_rbtnSave and the Text Save.... Close the dialog by clicking OK.

  5. In the Solution Explorer, select the form Form1 and choose Code from the View main menu. Attach two more events to the Form1 constructor code, so that the complete constructor code looks like this:

    Loading...
    Loading...
  6. Under the Form constructor code, add the following two new event handler methods:

    Loading...
    Loading...
  7. Build and start the application.

    When clicking on the File application menu, the two menu items are visible to load and save documents.

    image