This tutorial shows how to create a new .NET 8 Windows Forms application using the TX Text Control and supporting the Ribbon and Sidebar.
Creating the Project
-
Start Visual Studio and create a new Windows Forms project. In the dialog, select Windows Forms App and click Next.
Enter a name for the project and click Next.
-
Choose .NET 8 (Long Term Support) as the Framework and click Create.
Adding the NuGet Package
-
Open the Manage NuGet Packages dialog by right-clicking the project in the Solution Explorer and selecting Manage NuGet Packages....
-
Select Text Control Offline Packages as the Package source and click Browse.
-
Select TXTextControl.TextControl.WinForms.SDK and click Install.
Adding TX Text Control
-
In the Solution Explorer, open the form Form1 and find the TX Text Control 32.0 tab in the Toolbox, select it and draw in onto the form.
-
Click on the "Smart Tag" 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. Finally, click on Arrange Controls Automatically. The controls are now connected and docked to fill the container:
-
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 and a Add a RibbonViewTab.
Adding the Sidebar
-
Click on the "Smart Tag" in the upper right corner of TextControl again and choose Add Right Sidebar. Click on Arrange Controls Automatically again.
-
Click on the "Smart Tag" in the upper right corner of the sidebar control and choose Styles as the ContentLayout.
Running the Application
Press F5 to compile and start the application.
The application starts and the TX Text Control is connected to the Ribbon and the fully functioning Sidebar.
Sidebar Settings
The Sidebar comes with 10 out-of-the-box content layouts that can be added.
- Goto
- FieldNavigator
- TrackedChanges
- Styles
- Find
- Replace
- ConditionalInstructions
- DocumentSettings
- Comments
- About
In addition, you can also add custom content by passing a custom control to the Content
╰ Windows.Forms Namespace
╰ Sidebar Class
╰ ContentLayout Property
Determines the content layout that has to be intialized and rendered for the Sidebar. property.