Skybound Rebar

RebarButton Constructor

Initializes a new instance of a RebarButton.

Overload List

Initializes a new instance of a RebarButton.

public RebarButton();

Initializes a new instance of a RebarButton and specifies a name and type for the new button.

public RebarButton(string,RebarButtonType);

Initializes a new instance of a RebarButton and specifies a name, text, an image, whether the button is initially enabled and the type for the new button.

public RebarButton(string,string,Image,bool,RebarButtonType);

Initializes a new instance of a RebarButton that is a toggle or group button.

public RebarButton(string,string,Image,bool,RebarButtonType,bool);

Initializes a new instance of a RebarButton with a menu.

public RebarButton(string,string,Image,bool,RebarButtonType,ContextMenu);

Initializes a new instance of a RebarButton that is a panel.

public RebarButton(string,Control,bool,int);

Remarks

For overloads that accept an Image value, specifying a null reference (Nothing in Visual Basic) for the image will cause the TextVisible property of the new button to default to true.

Example

This example adds several buttons to an existing RebarBand.

private void InitializeBand(RebarBand band)
{
    // add "back" and "forward" menu buttons
    band.Buttons.Add(new RebarButton(
        "btnBack", "Back", null, true, RebarButtonType.MenuOrPush, null
        ));
    band.Buttons.Add(new RebarButton(
        "btnForward", "Forward", null, true, RebarButtonType.MenuOrPush, null
        ));

    // add a toggle button, default to checked
    band.Buttons.Add(new RebarButton(
        "btnToggle", "Toggle", null, true, RebarButtonType.Toggle, true
        ));

    // add a separator bar
    band.Buttons.Add(new RebarButton("btnSeparator0", RebarButtonType.Separator));

    // add three group buttons. only one will be checked at once,
    // and the default is "Medium":
    band.Buttons.Add(new RebarButton(
        "btnSlow", "Slow", null, true, RebarButtonType.Group, false
        ));
    band.Buttons.Add(new RebarButton(
        "btnMedium", "Medium", null, true, RebarButtonType.Group, true
        ));
    band.Buttons.Add(new RebarButton(
        "btnFast", "Fast", null, true, RebarButtonType.Group, false
        ));

    // add another separator bar
    band.Buttons.Add(new RebarButton("btnSeparator1", RebarButtonType.Separator));

    // add a panel that will host a combo box
    band.Buttons.Add(new RebarButton("btnAddress", new ComboBox(), true, 100));
}
            

See Also

RebarButton Class | Skybound.Rebar Namespace