Skybound Rebar

RebarBandEventArgs Class

Provides data for the RebarBandEventHandler event.

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

System.Object
   System.EventArgs
      Skybound.Rebar.RebarBandEventArgs

[Visual Basic]
Public Class RebarBandEventArgs
    Inherits EventArgs
[C#]
public class RebarBandEventArgs : EventArgs

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

The RebarBandEventArgs class provides a reference to the RebarBand that raised the event. Since the DragBand and DragBandComplete events are members of Rebar, the sender argument to these event handlers specifies the Rebar control itself. Use the Band property to determine the band being dragged.

Example

This example handles the DragBand, DragBandComplete and DrawBand events of a Rebar control. It demonstrates two things:

This example requires the following:

private void rebar_DragBand(object sender, Skybound.Rebar.RebarBandEventArgs e)
{
    // set status bar text to the text on the band:
    statusBar.Text = e.Band.Text;
    // force band to repaint:
    e.Band.Refresh();
}

private void rebar_DragBandComplete(object sender, Skybound.Rebar.RebarBandEventArgs e)
{
    // clear status bar text:
    statusBar.Text = "";
    // force band to repaint:
    e.Band.Refresh();
}

private void rebar_DrawBand(object sender, Skybound.Rebar.DrawBandEventArgs e)
{
    // ensure that a band is dragging, and that the band we are drawing is being dragged:
    if (rebar.IsDragging && rebar.DraggingBand == e.Band)
    {
        // fill background of band with a semi-transparent brush, based on the system highlight color
        using (SolidBrush brush = new SolidBrush(Color.FromArgb(96, SystemColors.Highlight)))
            e.Graphics.FillRectangle(brush, e.Renderer.Bounds);
    }
    // call default implementation to render the band:
    e.Renderer.RenderBand(e.Graphics);
}
            

Requirements

Namespace: Skybound.Rebar

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

See Also

RebarBandEventArgs Members | Skybound.Rebar Namespace