Gets the RebarBand that is currently being dragged.
The RebarBand being dragged, or a null reference (Nothing in Visual Basic) if no band is currently being dragged.
You can also use the IsDragging property to determine whether or not a band is being dragged.
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);
}
Rebar Class | Skybound.Rebar Namespace