The Control Host item enables the user to add a hosted control in the RibbonGroup of the C1Ribbon control. A ControlHost item can be added both through the designer as well as code. In both the cases, the user has to programmatically configure the hosted control in the MainForm. Let's say a user wants to add a TextBox control. For this, the user needs to create a new TextBoxHost class that inherits the RibbonControlHost element. Likewise, in order to add a ComboBox control, the user can create a new ComboBoxHost class that inherits the RibbonControlHost element.
The following sections cover in detail about the configuration of a ControlHost in the C1Ribbon control via both the designer and code.
Complete the following steps to add a standard TextBox control to a Ribbon group via the designer:
Notice that the TextBox control now appears in the Ribbon group.
The user can customize the look of the Ribbon ControlHost using the Ribbon TrackBar Floating ToolBar or by editing the properties in the Properties Window. For more information about floating toolbars, refer this topic.
The image below shows the floating toolbar of TextBox ControlHost.
The RibbonControlHost item can be added programmatically with the RibbonControlHost class as shown in the code below:
When the Ribbon is switched to its Simplified state, you can easily view the RibbonControlHost using the dropdown button as shown in the snapshot below.