# ToolBar

Namespace: **Wisej.Web**

Assembly: **Wisej.Framework** (4.0.0.0)

* [Control](/api/wisej.web/general/control.md)
  * [ToolBar](/api/wisej.web/containers/toolbar.md)

Represents a toolbar component.

{% tabs %}
{% tab title="C#" %}

```csharp
public class ToolBar : Control, IWisejDesignTarget
```

{% endtab %}

{% tab title="VB.NET" %}

```visual-basic
Public Class ToolBar
    Inherits Control
    Implements IWisejDesignTarget
```

{% endtab %}
{% endtabs %}

## Constructors

### ![](/files/hsR4ok3152WyAf8J2C1u) ToolBar()

Initializes a new instance of the [ToolBar](/api/wisej.web/containers/toolbar.md) class.

## Properties

### ![](/files/hsR4ok3152WyAf8J2C1u) AutoOverflow

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Enables the overflow handling which automatically removes items that don't fit in the [ToolBar](/api/wisej.web/containers/toolbar.md) and adds them to a drop-down menu button. (Default: `True`)

### ![](/files/hsR4ok3152WyAf8J2C1u) AutoSize

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns or sets whether the toolbar adjusts its size automatically, based on the size of the buttons and the dock style. (Default: `True`)

### ![](/files/hsR4ok3152WyAf8J2C1u) BorderStyle

[BorderStyle](/api/wisej.web/enumerations/wisej.web.borderstyle.md): Returns or sets the border style of the toolbar control. (Default: `None`)

### ![](/files/hsR4ok3152WyAf8J2C1u) ButtonCount

[Int32](https://docs.microsoft.com/dotnet/api/system.int32): Returns the number of child buttons without forcing the creation of the collection.

### ![](/files/hsR4ok3152WyAf8J2C1u) Buttons

[ToolBarButtonCollection](/api/wisej.web/containers/toolbar/wisej.web.toolbar.toolbarbuttoncollection.md): Returns the collection of [ToolBarButton](/api/wisej.web/containers/toolbar/wisej.web.toolbarbutton.md) controls assigned to the toolbar control.

### ![](/files/hsR4ok3152WyAf8J2C1u) CausesValidation

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns or sets whether clicking ToolBar buttons causes validation to be performed on the active control. (Default: `False`)

### ![](/files/lzopMboA31bVq8UIcbT3) DefaultSize

[Size](https://docs.microsoft.com/dotnet/api/system.drawing.size):

### ![](/files/hsR4ok3152WyAf8J2C1u) Dock

[DockStyle](/api/wisej.web/enumerations/wisej.web.dockstyle.md): (Default: `Top`)

### ![](/files/hsR4ok3152WyAf8J2C1u) ImageList

[ImageList](/api/wisej.web/content/imagelist.md): Returns or sets the collection of images available to the toolbar button controls. (Default: `null`)

### ![](/files/hsR4ok3152WyAf8J2C1u) ShowToolTips

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns or sets whether the toolbar displays a ToolTip for each button. (Default: `True`)

### ![](/files/hsR4ok3152WyAf8J2C1u) TextAlign

[ToolBarTextAlign](/api/wisej.web/containers/toolbar/wisej.web.toolbartextalign.md): Returns or sets the alignment of text in relation to each image displayed on the toolbar button controls. (Default: `Underneath`)

## Methods

### ![](/files/lzopMboA31bVq8UIcbT3) Dispose(disposing)

Disposes of the resources (other than memory) used by the [ToolBar](/api/wisej.web/containers/toolbar.md).

| Parameter     | Type                                                            | Description                                                                 |
| ------------- | --------------------------------------------------------------- | --------------------------------------------------------------------------- |
| **disposing** | [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean) | true when this method is called by the application rather than a finalizer. |

### ![](/files/lzopMboA31bVq8UIcbT3) OnAddReferences(items)

Returns a collection of referenced components or collection of components.

| Parameter | Type                                                                    | Description |
| --------- | ----------------------------------------------------------------------- | ----------- |
| **items** | [IList](https://docs.microsoft.com/dotnet/api/system.collections.ilist) |             |

### ![](/files/lzopMboA31bVq8UIcbT3) OnBindingContextChanged(e)

Fires the [BindingContextChanged](/api/wisej.web/general/control.md#bindingcontextchanged) event.

| Parameter | Type                                                                | Description                                                                                          |
| --------- | ------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
| **e**     | [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) | An [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) that contains the event data. |

### ![](/files/hsR4ok3152WyAf8J2C1u) OnButtonClick(e)

Fires the [ButtonClick](#buttonclick) event.

| Parameter | Type                                                                                                      | Description                                                                                                                               |
| --------- | --------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| **e**     | [ToolBarButtonClickEventArgs](/api/wisej.web/containers/toolbar/wisej.web.toolbarbuttonclickeventargs.md) | A [ToolBarButtonClickEventArgs](/api/wisej.web/containers/toolbar/wisej.web.toolbarbuttonclickeventargs.md) that contains the event data. |

### ![](/files/lzopMboA31bVq8UIcbT3) OnButtonDropDown(e)

Fires the [ButtonDropDown](#buttondropdown) event.

| Parameter | Type                                                                                                      | Description                                                                                                                               |
| --------- | --------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| **e**     | [ToolBarButtonClickEventArgs](/api/wisej.web/containers/toolbar/wisej.web.toolbarbuttonclickeventargs.md) | A [ToolBarButtonClickEventArgs](/api/wisej.web/containers/toolbar/wisej.web.toolbarbuttonclickeventargs.md) that contains the event data. |

### ![](/files/lzopMboA31bVq8UIcbT3) OnEnabledChanged(e)

Fires the [EnabledChanged](/api/wisej.web/general/control.md#enabledchanged) event.

| Parameter | Type                                                                | Description                                                                                          |
| --------- | ------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
| **e**     | [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) | An [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) that contains the event data. |

### ![](/files/lzopMboA31bVq8UIcbT3) OnWebEvent(e)

Processes the event from the client.

| Parameter | Type                                                        | Description      |
| --------- | ----------------------------------------------------------- | ---------------- |
| **e**     | [WisejEventArgs](/api/wisej.core/general/wisejeventargs.md) | Event arguments. |

### ![](/files/lzopMboA31bVq8UIcbT3) OnWebRender(config)

Renders the client component.

| Parameter  | Type                                                          | Description                   |
| ---------- | ------------------------------------------------------------- | ----------------------------- |
| **config** | [Object](https://docs.microsoft.com/dotnet/api/system.object) | Dynamic configuration object. |

### ![](/files/lzopMboA31bVq8UIcbT3) SetBoundsCore(x, y, width, height, specified)

Sets the specified bounds of the [ToolBar](/api/wisej.web/containers/toolbar.md) control.

| Parameter     | Type                                                                        | Description                                                                                              |
| ------------- | --------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
| **x**         | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                 | The new Left property value of the control.                                                              |
| **y**         | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                 | The new Top property value of the control.                                                               |
| **width**     | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                 | The new Width property value of the control.                                                             |
| **height**    | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                 | Not used.                                                                                                |
| **specified** | [BoundsSpecified](/api/wisej.web/enumerations/wisej.web.boundsspecified.md) | A combination of the [BoundsSpecified](/api/wisej.web/enumerations/wisej.web.boundsspecified.md) values. |

### ![](/files/hsR4ok3152WyAf8J2C1u) ValidateActiveControl()

Validates the current control.

**Returns:** [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean). true if the active control is validated.

## Events

### ![](/files/hsR4ok3152WyAf8J2C1u) AutoSizeChanged

[EventHandler](https://docs.microsoft.com/dotnet/api/system.eventhandler) Fired when the value of the [AutoSize](#autosize) property has changed.

### ![](/files/hsR4ok3152WyAf8J2C1u) ButtonClick

[ToolBarButtonClickEventHandler](/api/wisej.web/containers/toolbar/wisej.web.toolbarbuttonclickeventhandler.md) Fired when a [ToolBarButton](/api/wisej.web/containers/toolbar/wisej.web.toolbarbutton.md) on the [ToolBar](/api/wisej.web/containers/toolbar.md) is clicked.

### ![](/files/hsR4ok3152WyAf8J2C1u) ButtonDropDown

[ToolBarButtonClickEventHandler](/api/wisej.web/containers/toolbar/wisej.web.toolbarbuttonclickeventhandler.md) Fired when a drop-down style [ToolBarButton](/api/wisej.web/containers/toolbar/wisej.web.toolbarbutton.md) or its down arrow is clicked.

## Implements

| Name                                                                              | Description                                                                                                           |
| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
| [IUserData](/api/wisej.web/interfaces/wisej.web.iuserdata.md)                     | Provides access to the `UserData` and `Tag` properties associated to the component implementing this interface.       |
| [IBindableComponent](/api/wisej.web/data-binding/wisej.web.ibindablecomponent.md) | Bindable components implement this interface.                                                                         |
| [IDropTarget](/api/wisej.web/interfaces/wisej.web.idroptarget.md)                 | Controls that support drag & drop operations implement this interface.                                                |
| [IWisejComponent](/api/wisej.core/interfaces/wisej.core.iwisejcomponent.md)       | All wisej components implement this interface.                                                                        |
| [IWisejControl](/api/wisej.core/interfaces/wisej.core.iwisejcontrol.md)           | All wisej controls derived from the [Control](/api/wisej.web/general/control.md) class must implement this interface. |
| [IWisejSerializable](/api/wisej.core/interfaces/wisej.core.iwisejserializable.md) | Allows an object to serialize itself.                                                                                 |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wisej.com/api/wisej.web/containers/toolbar.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
