RibbonButton.ControlSize Property (2007 System)
Gets or sets the size of the button.
Namespace: Microsoft.Office.Tools.Ribbon
Assembly: Microsoft.Office.Tools.Common.v9.0 (in Microsoft.Office.Tools.Common.v9.0.dll)
Syntax
'Declaration
Public Property ControlSize As RibbonControlSize
'Usage
Dim instance As RibbonButton
Dim value As RibbonControlSize
value = instance.ControlSize
instance.ControlSize = value
public RibbonControlSize ControlSize { get; set; }
public:
property RibbonControlSize ControlSize {
RibbonControlSize get ();
void set (RibbonControlSize value);
}
public function get ControlSize () : RibbonControlSize
public function set ControlSize (value : RibbonControlSize)
Property Value
Type: 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 Visual Studio Tools for Office project.
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