Ribbon for WinForms | ComponentOne
Elements / Ribbon Items / Font ComboBox
In This Topic
    Font ComboBox
    In This Topic

    The Font ComboBox is a combination of drop-down list and list box that shows the available font styles. It also provides a single-line text box. The user can click the Font ComboBox to view the dropdown list of available font styles.

    Font combobox

    Adding FontComboBox at Design-Time

    The Ribbon FontComboBox can be added at design-time using the Ribbon Group Floating Toolbar or RibbonGroup Items Collection Editor. Also, you can customize the look of the Ribbon FontComboBox using the Ribbon FontComboBox Floating ToolBar or editing the properties in the Properties window. Refer this topic for more information on floating toolbars. You can add items to the dropdown menu of FontComboBox using the RibbonFontComboBox Menu Items Collection Editor. For more information on Collection Editors, refer this topic.

    The image below shows the floating toolbar of FontComboBox.

    Floating toolbar

    Adding FontComboBox via Code

    A Font ComboBox can also be added to the C1Ribbon control through the code using the RibbonFontComboBox class. This is depicted in the code below:

    'Add FontComboBox ribbon item
    Dim fontComboBox As RibbonFontComboBox = New RibbonFontComboBox()
    fontComboBox.Text = "Select a font"
    fontComboBox.AutoCompleteMode = ComboBoxAutoCompleteMode.Suggest
    formatGroup.Items.Add(fontComboBox)
    
    // Add FontComboBox ribbon item
    RibbonFontComboBox fontComboBox = new RibbonFontComboBox();
    fontComboBox.Text = "Select a font";
    fontComboBox.AutoCompleteMode = ComboBoxAutoCompleteMode.Suggest;
    formatGroup.Items.Add(fontComboBox);