# Bar class

Namespace: [Grasshopper2.UI.Toolbar](https://developer.rhino3d.com/api/gh2/namespace/grasshopper2.ui.toolbar.md) · Assembly: [Grasshopper2](https://developer.rhino3d.com/api/gh2/assembly/grasshopper2.md)

```cs
public sealed class Bar : IResponsive, IBundleAware
```

A collection of option and toggle buttons.

## Constructors

- [Bar](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.toolbar.bar/ctor.md): (2 overloads) Create an empty tool bar.

## Fields

- [CategoryHeight](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.toolbar.bar/categoryheight.md): (static) Gets the height of the category label area underneath the bar.
- [DefaultElementHeight](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.toolbar.bar/defaultelementheight.md): (static) Default height of the element portion of the bar.

## Properties

- [ActiveElements](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.toolbar.bar/activeelements.md): Enumerate over all elements in this bar that are not spacers.
- [Bounds](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.toolbar.bar/bounds.md): Gets or sets the bounds for this bar.
- [Bundle](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.toolbar.bar/bundle.md): Gets the bundle which contains this toolbar.
- [Count](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.toolbar.bar/count.md): Gets the number of elements on this bar.
- [ElementHeight](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.toolbar.bar/elementheight.md): Gets or sets the height of the element portion of the bar. Default value is designed to give a 16x16 icon when subtracting two pixels from the edges.
- [Elements](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.toolbar.bar/elements.md): Enumerate over all elements in this bar.
- [Enabled](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.toolbar.bar/enabled.md): Gets or sets the enabled state of this bar.
- [Height](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.toolbar.bar/height.md): Gets the height of this toolbar.
- [MaximumWidth](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.toolbar.bar/maximumwidth.md): Gets the maximum width of this toolbar.
- [MinimumWidth](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.toolbar.bar/minimumwidth.md): Gets the minimum width of this toolbar.
- [Responder](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.toolbar.bar/responder.md)
- [Style](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.toolbar.bar/style.md): Gets or sets the style of this toolbar.

## Indexers

- [this[]](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.toolbar.bar/item.md): (2 overloads) Gets the element at the given index.

## Methods

- [Add](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.toolbar.bar/add.md): Add an element to this toolbar.
- [AddColours](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.toolbar.bar/addcolours.md): Add a series of [RadioToggle](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.toolbar.radiotoggle.md) options to this bar. This also sets the style to not display categories and the element height to 16.
- [AddCoolColours](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.toolbar.bar/addcoolcolours.md): Add a series of [RadioToggle](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.toolbar.radiotoggle.md) options to this bar representing the standard cool (blue/purple) colours. This also sets the style to not display categories and the element height to 16.
- [AddLifeColours](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.toolbar.bar/addlifecolours.md): Add a series of [RadioToggle](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.toolbar.radiotoggle.md) options to this bar representing the standard neutral (green) colours. This also sets the style to not display categories and the element height to 16.
- [AddPushButton](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.toolbar.bar/addpushbutton.md): Add a button to this bar.
- [AddRadioToggle](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.toolbar.bar/addradiotoggle.md): Add a push option to this bar.
- [AddSpacer](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.toolbar.bar/addspacer.md): (2 overloads) Add a spacer to this bar.
- [AddTextField](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.toolbar.bar/addtextfield.md): Add a text field to this bar.
- [AddToggle](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.toolbar.bar/addtoggle.md): Add a narrow toggle option which enables/disables all elements that follow it with the given section names.
- [AddWarmColours](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.toolbar.bar/addwarmcolours.md): Add a series of [RadioToggle](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.toolbar.radiotoggle.md) options to this bar representing the standard warm (red/yellow) colours. This also sets the style to not display categories and the element height to 16.
- [CreateStandardColourBars](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.toolbar.bar/createstandardcolourbars.md): (static) Create the three standard colour picker bars.
- [Find<T>](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.toolbar.bar/find.md): Find the first element of the specified type with the specified name.
- [IndexOf](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.toolbar.bar/indexof.md): Find the index of the given element.
- [Invalidate](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.toolbar.bar/invalidate.md): Raise the [Bar.Invalidated](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.toolbar.bar/invalidated.md) event.
- [ItemAt](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.toolbar.bar/itemat.md): Find the element at the given point.
- [Layout](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.toolbar.bar/layout.md): Perform layout to the current bounds.
- [OnTooltipDetails](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.toolbar.bar/ontooltipdetails.md)
- [Render](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.toolbar.bar/render.md): Draw this toggle bar to a graphics context.
- [ShowTooltipAt](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.toolbar.bar/showtooltipat.md): Show a tooltip at the given location.

## Events

- [CloseRequested](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.toolbar.bar/closerequested.md): Request the closing of any form containing this bar.
- [Invalidated](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.toolbar.bar/invalidated.md): Raised when the display of this toolbar changes and a redraw is required.
- [TooltipDetails](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.toolbar.bar/tooltipdetails.md)
