RibbonButton.ControlSize Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets the size of the button.
public:
property Microsoft::Office::Core::RibbonControlSize ControlSize { Microsoft::Office::Core::RibbonControlSize get(); void set(Microsoft::Office::Core::RibbonControlSize value); };
public Microsoft.Office.Core.RibbonControlSize ControlSize { get; set; }
member this.ControlSize : Microsoft.Office.Core.RibbonControlSize with get, set
Public Property ControlSize As RibbonControlSize
Property Value
A Microsoft.Office.Core.RibbonControlSize that represents the size of the button.
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 void SetButtonProperties()
{
button1.ControlSize =
Microsoft.Office.Core.RibbonControlSize.RibbonControlSizeLarge;
button1.Description = "My Ribbon Button";
}
Private Sub SetButtonProperties()
Button1.ControlSize = _
Microsoft.Office.Core.RibbonControlSize.RibbonControlSizeLarge
button1.Description = "My Ribbon Button"
End Sub
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
.