# MenuBar

Namespace: **Wisej.Web**

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

* [Control](/api/wisej.web/general/control.md)
  * [MenuBar](/api/wisej.web/menus/wisej.web.menubar.md)

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

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

Initializes a new instance of the [MenuBar](/api/wisej.web/menus/wisej.web.menubar.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 [MenuBar](/api/wisej.web/menus/wisej.web.menubar.md) and adds them to a drop-down menu button. (Default: `True`)

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

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

### ![](/files/hsR4ok3152WyAf8J2C1u) 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`)

### ![](/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: `None`)

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

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

## Methods

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

Disposes of the resources (other than memory) used by the [MenuBar](/api/wisej.web/menus/wisej.web.menubar.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/lzopMboA31bVq8UIcbT3) OnEnabledChanged(e)

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

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

Fires the [MenuItemAdded](#menuitemadded) event.

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

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

Fired the [MenuItemClicked](#menuitemclicked) event.

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

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

Fires the [MenuItemRemoved](#menuitemremoved) event.

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

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

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

### ![](/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 [MenuBar](/api/wisej.web/menus/wisej.web.menubar.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. |

## Events

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

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

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

[MenuItemEventHandler](/api/wisej.web/menus/wisej.web.menuitemeventhandler.md) Fired when a menu item is clicked.

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

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

## 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/menus/wisej.web.menubar.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.
