User Interface / Widgets / Ribbon / Ribbon Group Widgets / Ribbon Buttons
In This Topic
    Ribbon Buttons
    In This Topic
     Ribbon Buttons Overview

    Ribbon buttons extend regular buttons with support for ribbon widget states:

    For each ribbon button you can specify LargeImageSmallImage and Text. You can also specify the spacing between the image and the text using the ImageTextSpacing property. For convenience, most ribbon widgets provide static "Create" methods, which can be used to quickly create instances of the specific ribbon widget and the ribbon button is no exception. The following code example shows how to create a button in small initial state:

    Ribbon Button in Small Initial State
    Copy Code
    NRibbonButton button = NRibbonButton.CreateSmall("Decrease Indent", NResources.Image_16x16_paragraph_indent_left_png);
    

    Besides ribbon buttons, Nevron Open Vision also provides ribbon toggle buttons and ribbon repeat buttons, implemented by the NRibbonToggleButton class and the NRibbonRepeatButton class respectively. They behave just like regular toggle buttons and repeat button, but also provide support for ribbon widget states and small and large image like the ribbon buttons.

     Alert Ribbon Buttons

    To create an alert ribbon button set the UserClass of the button to NUITheme.UserClassAlert, which is a constant for the string "Alert":

    Alert Ribbon Button
    Copy Code
    NRibbonButton ribbonButton = new NRibbonButton("Format Painter", null, NResources.Image_Ribbon_16x16_copy_format_png);
    ribbonButton.UserClass = NUITheme.UserClassAlert; // Make this an alert button (i.e. a red button)
    collapsiblePanel.Add(ribbonButton);
    

    The code above will create the following alert button (colored in red):

    See Also