Removes a specific RebarBand from this instance.
To remove RebarBand objects from the collection you may also use the RemoveAt method.
To add new RebarBand objects to the collection, use the Add or Insert methods.
This example removes an existing RebarBand from a Rebar control if it exists and adds and inserts three new RebarBand object to the Rebar.
private void UpdateRebarBands(Skybound.Rebar.Rebar rebar, Skybound.Rebar.RebarBand toRemove) { // if toRemove is in in the collection, remove it: if(rebar.Bands.Contains(toRemove)) { rebar.Bands.Remove(toRemove); } // create three new rebar bands: RebarBand bandMenu = new RebarBand(RebarBandType.MenuBar); RebarBand bandTools = new RebarBand(RebarBandType.ToolBar); RebarBand bandAddress = new RebarBand(RebarBandType.ToolBar, "Address", null); // add the first two bands to the rebar: rebar.Bands.Add(bandMenu); rebar.Bands.Add(bandTools); // insert the third band before the first. Note that although the index of this band // in the collection will be zero, it will still be physically ordered after the previous // two bands on the screen rebar.Bands.Insert(0, bandAddress); }
Rebar.RebarBandCollection Class | Skybound.Rebar Namespace