Ribbon for WinForms | ComponentOne
In This Topic
    Appearance
    In This Topic

    Ribbon allows you to customize the appearance of the control as a whole or its elements individually, to enrich the presentation. This topic discusses about customizing the ribbon elements.

    Font For Elements

    The UpdatingItemFont event of C1Ribbon and C1StatusBar class allows to change the font of individual ribbon elements such as RibbonButton, RibbonCheckBox, RibbonGallery, RibbonMenu, RibbonSplitButton, and RibbonToggleButton. This event is triggered before a font is applied to the ribbon item. The following code illustrates the usage of UpdatingItemFont event to set font, font size, and style as "Arial", 12, and Bold respectively for a RibbonButton named btnSave, and remaining elements with "Times New Roman" as the font and font size as 9.

    C#
    Copy Code
    private void c1Ribbon1_UpdatingItemFont(object sender, C1.Win.Ribbon.UpdatingItemFontEventArgs e)
    {
        
        if (e.RibbonItem.Name == "btnSave")
            e.NewFont = new Font("Arial", 12, FontStyle.Bold);
        else
            e.NewFont = new Font("Times New Roman", 9);
        
    }
    

    Following image is the output of above code snippet

    Output of the custom font for ribbon items