> For the complete documentation index, see [llms.txt](https://docs.wisej.com/api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.wisej.com/api/v3.2/wisej.web/buttons/button.md).

# Button

Namespace: **Wisej.Web**

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

* [Control](/api/v3.2/wisej.web/general/control.md)
  * [ButtonBase](/api/v3.2/wisej.web/buttons/wisej.web.buttonbase.md)
    * [Button](/api/v3.2/wisej.web/buttons/button.md)

Represents a button control.

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

```csharp
public class Button : ButtonBase, IButtonControl
```

{% endtab %}

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

```visual-basic
Public Class Button
    Inherits ButtonBase
    Implements IButtonControl
```

{% endtab %}
{% endtabs %}

## Constructors

### ![](/files/k9JaCemfGSiwecs59re6)Button()

Initializes a new instance of the [Button](/api/v3.2/wisej.web/buttons/button.md) class.

## Properties

### ![](/files/k9JaCemfGSiwecs59re6)AutoSizeMode

[AutoSizeMode](/api/v3.2/wisej.web/enumerations/wisej.web.autosizemode.md): Returns or sets the mode by which the [Button](/api/v3.2/wisej.web/buttons/button.md) automatically resizes itself. (Default: `GrowOnly`)

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

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

### ![](/files/k9JaCemfGSiwecs59re6)DialogResult

[DialogResult](/api/v3.2/wisej.web/enumerations/wisej.web.dialogresult.md): Returns or sets a value that is returned to the parent form when the button is clicked. (Default: `None`)

### ![](/files/k9JaCemfGSiwecs59re6)Display

[Display](/api/v3.2/wisej.web/enumerations/wisej.web.display.md): Returns or sets the [Display](/api/v3.2/wisej.web/enumerations/wisej.web.display.md) mode of the control to determine whether to display the icon, the text or both. (Default: `Both`)

### ![](/files/k9JaCemfGSiwecs59re6)ImageSpacing

[Nullable\<Int32>](https://docs.microsoft.com/dotnet/api/system.nullable-1): Returns or sets the distance in pixels between the image and the label inside the button. (Default: `null`)

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

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

### ![](/files/k9JaCemfGSiwecs59re6)Repeat

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Enables or disables the auto-repeat feature. When enabled, the button keeps firing click events at an increasing rate while the user keeps the button pressed. (Default: `False`)

### ![](/files/k9JaCemfGSiwecs59re6)Shortcut

[Shortcut](/api/v3.2/wisej.web/enumerations/wisej.web.shortcut.md): Returns or sets a value indicating the shortcut key associated with the button. (Default: `None`)

## Methods

### ![](/files/k9JaCemfGSiwecs59re6)PerformClick()

Generates a [Click](/api/v3.2/wisej.web/general/control.md#click) event for a button.

## Events

### ![](/files/k9JaCemfGSiwecs59re6)ItemClicked

[MenuButtonItemClickedEventHandler](/api/v3.2/wisej.web/buttons/button/wisej.web.menubuttonitemclickedeventhandler.md) Fired when the user clicks one of the drop down menu items.

## Inherited By

| Name                                                                | Description                        |
| ------------------------------------------------------------------- | ---------------------------------- |
| [SplitButton](/api/v3.2/wisej.web/buttons/wisej.web.splitbutton.md) | Represents a split button control. |

## Implements

| Name                                                                                   | Description                                                                                                                |
| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| [IBindableComponent](/api/v3.2/wisej.web/data-binding/wisej.web.ibindablecomponent.md) | Bindable components implement this interface.                                                                              |
| [IButtonControl](/api/v3.2/wisej.web/interfaces/wisej.web.ibuttoncontrol.md)           | Allows a control to act like a button on a [Form](/api/v3.2/wisej.web/containers/form.md).                                 |
| [ICommandSource](/api/v3.2/wisej.web/interfaces/wisej.web.icommandsource.md)           | Defines an object that can invoke a [Command](/api/v3.2/wisej.web/interfaces/wisej.web.icommandsource.md#command).         |
| [IDropTarget](/api/v3.2/wisej.web/interfaces/wisej.web.idroptarget.md)                 | Controls that support drag & drop operations implement this interface.                                                     |
| [IImage](/api/v3.2/wisej.web/interfaces/wisej.web.iimage.md)                           | Provides access to common image properties across the controls that implement this interface.                              |
| [IWisejComponent](/api/v3.2/wisej.core/interfaces/wisej.core.iwisejcomponent.md)       | All wisej components implement this interface.                                                                             |
| [IWisejControl](/api/v3.2/wisej.core/interfaces/wisej.core.iwisejcontrol.md)           | All wisej controls derived from the [Control](/api/v3.2/wisej.web/general/control.md) class must implement this interface. |
| [IWisejSerializable](/api/v3.2/wisej.core/interfaces/wisej.core.iwisejserializable.md) | Allows an object to serialize itself.                                                                                      |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.wisej.com/api/v3.2/wisej.web/buttons/button.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
