# MenuBar

Namespace: **Wisej.Web**

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

* [Control](https://docs.wisej.com/api/wisej.web/general/control)
  * [MenuBar](https://docs.wisej.com/api/wisej.web/menus/wisej.web.menubar)

Represents a menu bar component.

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

```csharp
public class MenuBar : Control
```

{% endtab %}

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

```visual-basic
Public Class MenuBar
    Inherits Control
```

{% endtab %}
{% endtabs %}

## Constructors

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) MenuBar()

Initializes a new instance of the [MenuBar](https://docs.wisej.com/api/wisej.web/menus/wisej.web.menubar) class.

## Properties

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) AutoOverflow

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

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) BorderStyle

[BorderStyle](https://docs.wisej.com/api/wisej.web/enumerations/wisej.web.borderstyle): Returns or sets the border style of the [MenuBar](https://docs.wisej.com/api/wisej.web/menus/wisej.web.menubar) control. (Default: `None`)

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) CausesValidation

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns or sets whether the control causes validation to be performed on controls that require to be validated when this control receives focus. (Default: `False`)

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-9bf7fa01e02f4da0f9ef90d3b049ae43e664919e%2Fprotected.png?alt=media) DefaultSize

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

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Dock

[DockStyle](https://docs.wisej.com/api/wisej.web/enumerations/wisej.web.dockstyle): (Default: `None`)

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) MenuItems

[MenuItemCollection](https://docs.wisej.com/api/wisej.web/menus/wisej.web.menu.menuitemcollection): Returns the collection of [MenuItem](https://docs.wisej.com/api/wisej.web/menus/wisej.web.menuitem) objects associated with the menu.

## Methods

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-9bf7fa01e02f4da0f9ef90d3b049ae43e664919e%2Fprotected.png?alt=media) Dispose(disposing)

Disposes of the resources (other than memory) used by the [MenuBar](https://docs.wisej.com/api/wisej.web/menus/wisej.web.menubar).

| 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. |

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-9bf7fa01e02f4da0f9ef90d3b049ae43e664919e%2Fprotected.png?alt=media) 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) |             |

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-9bf7fa01e02f4da0f9ef90d3b049ae43e664919e%2Fprotected.png?alt=media) OnBindingContextChanged(e)

Fires the [BindingContextChanged](https://docs.wisej.com/api/general/control#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. |

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-9bf7fa01e02f4da0f9ef90d3b049ae43e664919e%2Fprotected.png?alt=media) OnEnabledChanged(e)

| Parameter | Type                                                                | Description |
| --------- | ------------------------------------------------------------------- | ----------- |
| **e**     | [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) |             |

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-9bf7fa01e02f4da0f9ef90d3b049ae43e664919e%2Fprotected.png?alt=media) OnMenuItemAdded(e)

Fires the [MenuItemAdded](#menuitemadded) event.

| Parameter | Type                                                                                        | Description                                                                                                                 |
| --------- | ------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| **e**     | [MenuItemEventArgs](https://docs.wisej.com/api/wisej.web/menus/wisej.web.menuitemeventargs) | A [MenuItemEventArgs](https://docs.wisej.com/api/wisej.web/menus/wisej.web.menuitemeventargs) that contains the event data. |

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-9bf7fa01e02f4da0f9ef90d3b049ae43e664919e%2Fprotected.png?alt=media) OnMenuItemClicked(e)

Fired the [MenuItemClicked](#menuitemclicked) event.

| Parameter | Type                                                                                        | Description                                                                                                                 |
| --------- | ------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| **e**     | [MenuItemEventArgs](https://docs.wisej.com/api/wisej.web/menus/wisej.web.menuitemeventargs) | A [MenuItemEventArgs](https://docs.wisej.com/api/wisej.web/menus/wisej.web.menuitemeventargs) that contains the event data. |

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-9bf7fa01e02f4da0f9ef90d3b049ae43e664919e%2Fprotected.png?alt=media) OnMenuItemRemoved(e)

Fires the [MenuItemRemoved](#menuitemremoved) event.

| Parameter | Type                                                                                        | Description                                                                                                                 |
| --------- | ------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| **e**     | [MenuItemEventArgs](https://docs.wisej.com/api/wisej.web/menus/wisej.web.menuitemeventargs) | A [MenuItemEventArgs](https://docs.wisej.com/api/wisej.web/menus/wisej.web.menuitemeventargs) that contains the event data. |

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-9bf7fa01e02f4da0f9ef90d3b049ae43e664919e%2Fprotected.png?alt=media) OnParentChanged(e)

| Parameter | Type                                                                | Description |
| --------- | ------------------------------------------------------------------- | ----------- |
| **e**     | [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) |             |

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-9bf7fa01e02f4da0f9ef90d3b049ae43e664919e%2Fprotected.png?alt=media) OnWebRender(config)

Renders the client component.

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

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-9bf7fa01e02f4da0f9ef90d3b049ae43e664919e%2Fprotected.png?alt=media) SetBoundsCore(x, y, width, height, specified)

Sets the specified bounds of the [MenuBar](https://docs.wisej.com/api/wisej.web/menus/wisej.web.menubar) 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](https://docs.wisej.com/api/wisej.web/enumerations/wisej.web.boundsspecified) | A combination of the [BoundsSpecified](https://docs.wisej.com/api/wisej.web/enumerations/wisej.web.boundsspecified) values. |

## Events

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) MenuItemAdded

[MenuItemEventHandler](https://docs.wisej.com/api/wisej.web/menus/wisej.web.menuitemeventhandler) Fired when a new menu item is added to the [MenuItemCollection](https://docs.wisej.com/api/wisej.web/menus/wisej.web.menu.menuitemcollection).

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) MenuItemClicked

[MenuItemEventHandler](https://docs.wisej.com/api/wisej.web/menus/wisej.web.menuitemeventhandler) Fired when a menu item is clicked.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) MenuItemRemoved

[MenuItemEventHandler](https://docs.wisej.com/api/wisej.web/menus/wisej.web.menuitemeventhandler) Fired when a menu item is removed from the [MenuItemCollection](https://docs.wisej.com/api/wisej.web/menus/wisej.web.menu.menuitemcollection).

## Implements

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