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:
Add a Ribbon (Visual Designer) item to a project created by using Office development tools in Visual Studio.
Add a group to the custom tab.
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
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
See Also
Reference
Microsoft.Office.Tools.Ribbon Namespace