# Button

Namespace: **Wisej.Web**

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

* [Control](https://docs.wisej.com/api/v2.2/wisej.web/general/control)
  * [ButtonBase](https://docs.wisej.com/api/v2.2/wisej.web/buttons/wisej.web.buttonbase)
    * [Button](https://docs.wisej.com/api/v2.2/wisej.web/buttons/button)

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

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

Initializes a new instance of the [Button](https://docs.wisej.com/api/v2.2/wisej.web/buttons/button) class.

## Properties

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

[AutoSizeMode](https://docs.wisej.com/api/v2.2/wisej.web/enumerations/wisej.web.autosizemode): Returns or sets the mode by which the [Button](https://docs.wisej.com/api/v2.2/wisej.web/buttons/button) automatically resizes itself.

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

[BorderStyle](https://docs.wisej.com/api/v2.2/wisej.web/enumerations/wisej.web.borderstyle): Returns or sets the border style of the button control.

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

[DialogResult](https://docs.wisej.com/api/v2.2/wisej.web/enumerations/wisej.web.dialogresult): Returns or sets a value that is returned to the parent form when the button is clicked.

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

[Display](https://docs.wisej.com/api/v2.2/wisej.web/enumerations/wisej.web.display): Returns or sets the [Display](https://docs.wisej.com/api/v2.2/wisej.web/enumerations/wisej.web.display) mode of the control to determine whether to display the icon, the text or both.

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

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

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

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

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

[Boolean](https://docs.microsoft.com/en-us/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.

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

[Shortcut](https://docs.wisej.com/api/v2.2/wisej.web/enumerations/wisej.web.shortcut): Returns or sets a value indicating the shortcut key associated with the button.

## Methods

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

Generates a [Click](https://docs.wisej.com/api/v2.2/general/control#click) event for a button.

## Events

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

[MenuButtonItemClickedEventHandler](https://docs.wisej.com/api/v2.2/wisej.web/buttons/button/wisej.web.menubuttonitemclickedeventhandler) Fired when the user clicks one of the drop down menu items.

## Inherited By

| Name                                                                                   | Description                        |
| -------------------------------------------------------------------------------------- | ---------------------------------- |
| [SplitButton](https://docs.wisej.com/api/v2.2/wisej.web/buttons/wisej.web.splitbutton) | Represents a split button control. |

## Implements

| Name                                                                                                      | Description                                                                                                                                   |
| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| [IBindableComponent](https://docs.wisej.com/api/v2.2/wisej.web/data-binding/wisej.web.ibindablecomponent) | Bindable components implement this interface.                                                                                                 |
| [IButtonControl](https://docs.wisej.com/api/v2.2/wisej.web/interfaces/wisej.web.ibuttoncontrol)           | Allows a control to act like a button on a [Form](https://docs.wisej.com/api/v2.2/wisej.web/containers/form).                                 |
| [IWisejComponent](https://docs.wisej.com/api/v2.2/wisej.core/interfaces/wisej.core.iwisejcomponent)       | All wisej components implement this interface.                                                                                                |
| [IWisejControl](https://docs.wisej.com/api/v2.2/wisej.core/interfaces/wisej.core.iwisejcontrol)           | All wisej controls derived from the [Control](https://docs.wisej.com/api/v2.2/wisej.web/general/control) class must implement this interface. |
| [IWisejSerializable](https://docs.wisej.com/api/v2.2/wisej.core/interfaces/wisej.core.iwisejserializable) | Allows an object to serialize itself.                                                                                                         |
