Export (0) Print
Expand All

RibbonButton.ControlSize Property

Gets or sets the size of the button.

Namespace:  Microsoft.Office.Tools.Ribbon
Assembly:  Microsoft.Office.Tools.Common (in Microsoft.Office.Tools.Common.dll)

RibbonControlSize ControlSize { get; set; }

Property Value

Type: Microsoft.Office.Core.RibbonControlSize
A Microsoft.Office.Core.RibbonControlSize that represents the size of the button.

This property has no effect if the button is part of a menu. A button that is part of a menu is always displayed as if its ControlSize property were set to the value of the parent menu's ItemSize property. To make buttons appear larger on a menu, set the ItemSize property of the RibbonMenu to Microsoft.Office.Core.RibbonControlSize.RibbonControlSizeLarge.

The following example makes a button appear larger. To run this code example, you must first perform the following steps:

  1. Add a Ribbon (Visual Designer) item to a project created by using Office development tools in Visual Studio.

  2. Add a group to the custom tab.

  3. Add a button to the group.

private void SetButtonProperties()
{
    button1.ControlSize =
        Microsoft.Office.Core.RibbonControlSize.RibbonControlSizeLarge;
    button1.Description = "My Ribbon Button";
}

Show:
© 2015 Microsoft