Skybound Rebar

RebarButton Class

Represents a button on a rebar band.

For a list of all members of this type, see RebarButton Members.

System.Object
   Skybound.Rebar.RebarButton

[Visual Basic]
Public Class RebarButton
    Implements ICustomTypeDescriptor
[C#]
public class RebarButton : ICustomTypeDescriptor

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Remarks

RebarButton controls are parented by RebarBand components. Common properties to set once the rebar button has been created are Text, Image and TextVisible. Set the Text property of the button to display text below or beside the image. You also can toggle whether the text is visible for a button by setting TextVisible. If the band has a chevron menu, it is important to set the Text property for every push button even if you do not intend to display it on the button because the text is also displayed in the chevron menu.

Each button has a ButtonType property that determines the behavior of the button. These types can be divided into three categories:

Each RebarButton can be assigned two images using Image and LargeImage. Use the UseLargeImages property of the RebarBand object to dynamically change whether the image for each button is drawn using the Image or LargeImage property.

You can assign a ContextMenu to a button if the ButtonType property is set to Menu or MenuOrPush. For Menu buttons, the assigned menu is displayed when the button is clicked. For MenuOrPush buttons, the assigned menu is displayed when the drop-down button is clicked.

Unlike the ToolBarButton components added to a Windows ToolBar control, rebar buttons do not implement IComponent, and are therefore not class members. By default, the only way to access the buttons in a band is through the Buttons property of the container band. This decision was made in order to decrease the overhead associated with adding a separate component to the form for every RebarButton. It is possible because the Skybound Rebar control does wrap any unmanaged Windows common controls and therefore there are no unmanaged resources to release when the control is destroyed.

Note that events handlers for rebar buttons are attached to the RebarBand that contains it. There is less overhead for attaching a single event handler to a rebar band than for attaching an event handler to each of the buttons separately.

To create a collection of RebarButton objects to display on a RebarBand, add the buttons individually by using the Add method of the Buttons property. Alternatively, you can add several rebar buttons using the AddRange method.

Requirements

Namespace: Skybound.Rebar

Assembly: Skybound.Rebar (in Skybound.Rebar.dll)

See Also

RebarButton Members | Skybound.Rebar Namespace