Skybound Rebar

RebarButton Constructor (String, String, Image, Boolean, RebarButtonType, ContextMenu)

Initializes a new instance of a RebarButton with a menu.

[Visual Basic]
Overloads Public Sub New( _
   ByVal name As String, _
   ByVal text As String, _
   ByVal image As Image, _
   ByVal enabled As Boolean, _
   ByVal buttonType As RebarButtonType, _
   ByVal menu As ContextMenu _
)
[C#]
public RebarButton(
   string name,
   string text,
   Image image,
   bool enabled,
   RebarButtonType buttonType,
   ContextMenu menu
);

Parameters

name
The name used to identify this button in code.
text
The text displayed on the button.
image
The Image displayed on the button.
enabled
Whether the button is enabled.
buttonType
A RebarButtonType value that specifies the type of button.
menu
The ContextMenu associated with this button.

Remarks

This overload has the necessary parameters for creating a rebar button that has a menu. Be sure to specify RebarButtonType.Menu or RebarButtonType.MenuOrPush for the buttonType parameter. You may specify a null reference (Nothing in Visual Basic) for menu if the button will not have a default context menu.

Specifying a null reference (Nothing in Visual Basic) for image will cause the TextVisible property of the new button to default to true.

Exceptions

Exception Type Condition
InvalidEnumArgumentException The buttonType is not one of the RebarButtonType values.

See Also

RebarButton Class | Skybound.Rebar Namespace | RebarButton Constructor Overload List