Condividi tramite


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)

Syntax

'Declaration
Property ControlSize As RibbonControlSize
RibbonControlSize ControlSize { get; set; }

Property Value

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

Remarks

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.

Examples

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 Sub SetButtonProperties()
    Button1.ControlSize = _
        Microsoft.Office.Core.RibbonControlSize.RibbonControlSizeLarge
    button1.Description = "My Ribbon Button" 
End Sub
private void SetButtonProperties()
{
    button1.ControlSize =
        Microsoft.Office.Core.RibbonControlSize.RibbonControlSizeLarge;
    button1.Description = "My Ribbon Button";
}

.NET Framework Security

See Also

Reference

RibbonButton Interface

Microsoft.Office.Tools.Ribbon Namespace

RibbonMenu

Other Resources

Ribbon Overview

Ribbon Object Model Overview