# ToolBarButtonExtensions

Namespace: **Wisej.Web.Markup**

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

Adds [fluent markup](https://learn.microsoft.com/en-us/dotnet/communitytoolkit/maui/markup/markup) extension methods to the [ToolBarButton](/api/wisej.web/containers/toolbar/wisej.web.toolbarbutton.md) class.

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

```csharp
public class ToolBarButtonExtensions
```

{% endtab %}

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

```visual-basic
Public Class ToolBarButtonExtensions
```

{% endtab %}
{% endtabs %}

## Methods

### ![](/files/lIX317sDtMTZJBi9oSIx) AllowHtml\<TToolBarButton>(toolbarButton, allow)

Sets whether HTML is allowed in the text of the [ToolBarButton](/api/wisej.web/containers/toolbar/wisej.web.toolbarbutton.md).

| Parameter          | Type                                                                                           | Description                                 |
| ------------------ | ---------------------------------------------------------------------------------------------- | ------------------------------------------- |
| **TToolBarButton** |                                                                                                | The type of the toolbar button.             |
| **toolbarButton**  | [TToolBarButton](/api/wisej.web.markup/extensions/wisej.web.markup.toolbarbuttonextensions.md) | The toolbar button to extend.               |
| **allow**          | [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean)                                | A value indicating whether HTML is allowed. |

**Returns:** [TToolBarButton](/api/wisej.web.markup/extensions/wisej.web.markup.toolbarbuttonextensions.md). The modified toolbar button.

### ![](/files/lIX317sDtMTZJBi9oSIx) AppearanceKey\<TToolBarButton>(toolbarButton, appearanceKey)

Sets the appearance key of the [ToolBarButton](/api/wisej.web/containers/toolbar/wisej.web.toolbarbutton.md).

| Parameter          | Type                                                                                           | Description                     |
| ------------------ | ---------------------------------------------------------------------------------------------- | ------------------------------- |
| **TToolBarButton** |                                                                                                | The type of the toolbar button. |
| **toolbarButton**  | [TToolBarButton](/api/wisej.web.markup/extensions/wisej.web.markup.toolbarbuttonextensions.md) | The toolbar button to extend.   |
| **appearanceKey**  | [String](https://docs.microsoft.com/dotnet/api/system.string)                                  | The appearance key to set.      |

**Returns:** [TToolBarButton](/api/wisej.web.markup/extensions/wisej.web.markup.toolbarbuttonextensions.md). The modified toolbar button.

### ![](/files/lIX317sDtMTZJBi9oSIx) AutoShowLoader\<TToolBarButton>(toolbarButton, autoShowLoader)

Sets whether the loader is automatically shown for the [ToolBarButton](/api/wisej.web/containers/toolbar/wisej.web.toolbarbutton.md).

| Parameter          | Type                                                                                           | Description                                                   |
| ------------------ | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------- |
| **TToolBarButton** |                                                                                                | The type of the toolbar button.                               |
| **toolbarButton**  | [TToolBarButton](/api/wisej.web.markup/extensions/wisej.web.markup.toolbarbuttonextensions.md) | The toolbar button to extend.                                 |
| **autoShowLoader** | [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean)                                | A value indicating whether the loader is automatically shown. |

**Returns:** [TToolBarButton](/api/wisej.web.markup/extensions/wisej.web.markup.toolbarbuttonextensions.md). The modified toolbar button.

### ![](/files/lIX317sDtMTZJBi9oSIx) DropDownMenu\<TToolBarButton>(toolbarButton, dropDownMenu)

Sets the DropDownMenu of the [ToolBarButton](/api/wisej.web/containers/toolbar/wisej.web.toolbarbutton.md).

| Parameter          | Type                                                                                           | Description                      |
| ------------------ | ---------------------------------------------------------------------------------------------- | -------------------------------- |
| **TToolBarButton** |                                                                                                | The type of the toolbar button.  |
| **toolbarButton**  | [TToolBarButton](/api/wisej.web.markup/extensions/wisej.web.markup.toolbarbuttonextensions.md) | The toolbar button to extend.    |
| **dropDownMenu**   | [ContextMenu](/api/wisej.web/menus/wisej.web.contextmenu.md)                                   | The drop-down menu to associate. |

**Returns:** [TToolBarButton](/api/wisej.web.markup/extensions/wisej.web.markup.toolbarbuttonextensions.md). The modified toolbar button.

### ![](/files/lIX317sDtMTZJBi9oSIx) Enabled\<TToolBarButton>(toolbarButton, enabled)

Sets the enabled state of the [ToolBarButton](/api/wisej.web/containers/toolbar/wisej.web.toolbarbutton.md).

| Parameter          | Type                                                                                           | Description                                       |
| ------------------ | ---------------------------------------------------------------------------------------------- | ------------------------------------------------- |
| **TToolBarButton** |                                                                                                | The type of the toolbar button.                   |
| **toolbarButton**  | [TToolBarButton](/api/wisej.web.markup/extensions/wisej.web.markup.toolbarbuttonextensions.md) | The toolbar button to extend.                     |
| **enabled**        | [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean)                                | A value indicating whether the button is enabled. |

**Returns:** [TToolBarButton](/api/wisej.web.markup/extensions/wisej.web.markup.toolbarbuttonextensions.md). The modified toolbar button.

### ![](/files/lIX317sDtMTZJBi9oSIx) ForeColor\<TToolBarButton>(toolbarButton, color)

Sets the foreground color of the [ToolBarButton](/api/wisej.web/containers/toolbar/wisej.web.toolbarbutton.md).

| Parameter          | Type                                                                                           | Description                     |
| ------------------ | ---------------------------------------------------------------------------------------------- | ------------------------------- |
| **TToolBarButton** |                                                                                                | The type of the toolbar button. |
| **toolbarButton**  | [TToolBarButton](/api/wisej.web.markup/extensions/wisej.web.markup.toolbarbuttonextensions.md) | The toolbar button to extend.   |
| **color**          | [Color](https://docs.microsoft.com/dotnet/api/system.drawing.color)                            | The color to set.               |

**Returns:** [TToolBarButton](/api/wisej.web.markup/extensions/wisej.web.markup.toolbarbuttonextensions.md). The modified toolbar button.

### ![](/files/lIX317sDtMTZJBi9oSIx) Image\<TToolBarButton>(toolbarButton, image)

Sets the image of the [ToolBarButton](/api/wisej.web/containers/toolbar/wisej.web.toolbarbutton.md).

| Parameter          | Type                                                                                           | Description                     |
| ------------------ | ---------------------------------------------------------------------------------------------- | ------------------------------- |
| **TToolBarButton** |                                                                                                | The type of the toolbar button. |
| **toolbarButton**  | [TToolBarButton](/api/wisej.web.markup/extensions/wisej.web.markup.toolbarbuttonextensions.md) | The toolbar button to extend.   |
| **image**          | [Image](https://docs.microsoft.com/dotnet/api/system.drawing.image)                            | The image to set.               |

**Returns:** [TToolBarButton](/api/wisej.web.markup/extensions/wisej.web.markup.toolbarbuttonextensions.md). The modified toolbar button.

### ![](/files/lIX317sDtMTZJBi9oSIx) ImageIndex\<TToolBarButton>(toolbarButton, imageIndex)

Sets the image index of the [ToolBarButton](/api/wisej.web/containers/toolbar/wisej.web.toolbarbutton.md).

| Parameter          | Type                                                                                           | Description                               |
| ------------------ | ---------------------------------------------------------------------------------------------- | ----------------------------------------- |
| **TToolBarButton** |                                                                                                | The type of the toolbar button.           |
| **toolbarButton**  | [TToolBarButton](/api/wisej.web.markup/extensions/wisej.web.markup.toolbarbuttonextensions.md) | The toolbar button to extend.             |
| **imageIndex**     | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                                    | The zero-based index of the image to set. |

**Returns:** [TToolBarButton](/api/wisej.web.markup/extensions/wisej.web.markup.toolbarbuttonextensions.md). The modified toolbar button.

### ![](/files/lIX317sDtMTZJBi9oSIx) ImageKey\<TToolBarButton>(toolbarButton, imageKey)

Sets the image key of the [ToolBarButton](/api/wisej.web/containers/toolbar/wisej.web.toolbarbutton.md).

| Parameter          | Type                                                                                           | Description                     |
| ------------------ | ---------------------------------------------------------------------------------------------- | ------------------------------- |
| **TToolBarButton** |                                                                                                | The type of the toolbar button. |
| **toolbarButton**  | [TToolBarButton](/api/wisej.web.markup/extensions/wisej.web.markup.toolbarbuttonextensions.md) | The toolbar button to extend.   |
| **imageKey**       | [String](https://docs.microsoft.com/dotnet/api/system.string)                                  | The image key to set.           |

**Returns:** [TToolBarButton](/api/wisej.web.markup/extensions/wisej.web.markup.toolbarbuttonextensions.md). The modified toolbar button.

### ![](/files/lIX317sDtMTZJBi9oSIx) ImageSource\<TToolBarButton>(toolbarButton, imageSource)

Sets the image source of the [ToolBarButton](/api/wisej.web/containers/toolbar/wisej.web.toolbarbutton.md).

| Parameter          | Type                                                                                           | Description                          |
| ------------------ | ---------------------------------------------------------------------------------------------- | ------------------------------------ |
| **TToolBarButton** |                                                                                                | The type of the toolbar button.      |
| **toolbarButton**  | [TToolBarButton](/api/wisej.web.markup/extensions/wisej.web.markup.toolbarbuttonextensions.md) | The toolbar button to extend.        |
| **imageSource**    | [String](https://docs.microsoft.com/dotnet/api/system.string)                                  | The image source URL or path to set. |

**Returns:** [TToolBarButton](/api/wisej.web.markup/extensions/wisej.web.markup.toolbarbuttonextensions.md). The modified toolbar button.

### ![](/files/lIX317sDtMTZJBi9oSIx) Margin\<TToolBarButton>(toolbarButton, margin)

Sets the margin of the [ToolBarButton](/api/wisej.web/containers/toolbar/wisej.web.toolbarbutton.md).

| Parameter          | Type                                                                                           | Description                     |
| ------------------ | ---------------------------------------------------------------------------------------------- | ------------------------------- |
| **TToolBarButton** |                                                                                                | The type of the toolbar button. |
| **toolbarButton**  | [TToolBarButton](/api/wisej.web.markup/extensions/wisej.web.markup.toolbarbuttonextensions.md) | The toolbar button to extend.   |
| **margin**         | [Padding](/api/wisej.web/general/wisej.web.padding.md)                                         | The margin to set.              |

**Returns:** [TToolBarButton](/api/wisej.web.markup/extensions/wisej.web.markup.toolbarbuttonextensions.md). The modified toolbar button.

### ![](/files/lIX317sDtMTZJBi9oSIx) Margin\<TToolBarButton>(toolbarButton, left, top, right, bottom)

Sets the margin of the [ToolBarButton](/api/wisej.web/containers/toolbar/wisej.web.toolbarbutton.md) using individual values.

| Parameter          | Type                                                                                           | Description                     |
| ------------------ | ---------------------------------------------------------------------------------------------- | ------------------------------- |
| **TToolBarButton** |                                                                                                | The type of the toolbar button. |
| **toolbarButton**  | [TToolBarButton](/api/wisej.web.markup/extensions/wisej.web.markup.toolbarbuttonextensions.md) | The toolbar button to extend.   |
| **left**           | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                                    | The left margin.                |
| **top**            | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                                    | The top margin.                 |
| **right**          | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                                    | The right margin.               |
| **bottom**         | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                                    | The bottom margin.              |

**Returns:** [TToolBarButton](/api/wisej.web.markup/extensions/wisej.web.markup.toolbarbuttonextensions.md). The modified toolbar button.

### ![](/files/lIX317sDtMTZJBi9oSIx) Name\<TToolBarButton>(toolbarButton, name)

Sets the name of the [ToolBarButton](/api/wisej.web/containers/toolbar/wisej.web.toolbarbutton.md).

| Parameter          | Type                                                                                           | Description                     |
| ------------------ | ---------------------------------------------------------------------------------------------- | ------------------------------- |
| **TToolBarButton** |                                                                                                | The type of the toolbar button. |
| **toolbarButton**  | [TToolBarButton](/api/wisej.web.markup/extensions/wisej.web.markup.toolbarbuttonextensions.md) | The toolbar button to extend.   |
| **name**           | [String](https://docs.microsoft.com/dotnet/api/system.string)                                  | The name to set.                |

**Returns:** [TToolBarButton](/api/wisej.web.markup/extensions/wisej.web.markup.toolbarbuttonextensions.md). The modified toolbar button.

### ![](/files/lIX317sDtMTZJBi9oSIx) OnClick\<TToolBarButton>(toolbarButton, action)

Attaches an action to the Click event of the [ToolBarButton](/api/wisej.web/containers/toolbar/wisej.web.toolbarbutton.md).

| Parameter          | Type                                                                                           | Description                                       |
| ------------------ | ---------------------------------------------------------------------------------------------- | ------------------------------------------------- |
| **TToolBarButton** |                                                                                                | The type of the toolbar button.                   |
| **toolbarButton**  | [TToolBarButton](/api/wisej.web.markup/extensions/wisej.web.markup.toolbarbuttonextensions.md) | The toolbar button to extend.                     |
| **action**         | [Action\<TToolBarButton>](https://docs.microsoft.com/dotnet/api/system.action-1)               | The action to perform when the button is clicked. |

**Returns:** [TToolBarButton](/api/wisej.web.markup/extensions/wisej.web.markup.toolbarbuttonextensions.md). The modified toolbar button.

### ![](/files/lIX317sDtMTZJBi9oSIx) OnPushedChanged\<TToolBarButton>(toolbarButton, action)

Attaches an action to the PushedChanged event of the [ToolBarButton](/api/wisej.web/containers/toolbar/wisej.web.toolbarbutton.md).

| Parameter          | Type                                                                                           | Description                                          |
| ------------------ | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------- |
| **TToolBarButton** |                                                                                                | The type of the toolbar button.                      |
| **toolbarButton**  | [TToolBarButton](/api/wisej.web.markup/extensions/wisej.web.markup.toolbarbuttonextensions.md) | The toolbar button to extend.                        |
| **action**         | [Action\<TToolBarButton>](https://docs.microsoft.com/dotnet/api/system.action-1)               | The action to perform when the pushed state changes. |

**Returns:** [TToolBarButton](/api/wisej.web.markup/extensions/wisej.web.markup.toolbarbuttonextensions.md). The modified toolbar button.

### ![](/files/lIX317sDtMTZJBi9oSIx) Padding\<TToolBarButton>(toolbarButton, padding)

Sets the padding of the [ToolBarButton](/api/wisej.web/containers/toolbar/wisej.web.toolbarbutton.md).

| Parameter          | Type                                                                                           | Description                     |
| ------------------ | ---------------------------------------------------------------------------------------------- | ------------------------------- |
| **TToolBarButton** |                                                                                                | The type of the toolbar button. |
| **toolbarButton**  | [TToolBarButton](/api/wisej.web.markup/extensions/wisej.web.markup.toolbarbuttonextensions.md) | The toolbar button to extend.   |
| **padding**        | [Padding](/api/wisej.web/general/wisej.web.padding.md)                                         | The padding to set.             |

**Returns:** [TToolBarButton](/api/wisej.web.markup/extensions/wisej.web.markup.toolbarbuttonextensions.md). The modified toolbar button.

### ![](/files/lIX317sDtMTZJBi9oSIx) Padding\<TToolBarButton>(toolbarButton, left, top, right, bottom)

Sets the padding of the [ToolBarButton](/api/wisej.web/containers/toolbar/wisej.web.toolbarbutton.md) with specified left, top, right, and bottom values.

| Parameter          | Type                                                                                           | Description                     |
| ------------------ | ---------------------------------------------------------------------------------------------- | ------------------------------- |
| **TToolBarButton** |                                                                                                | The type of the toolbar button. |
| **toolbarButton**  | [TToolBarButton](/api/wisej.web.markup/extensions/wisej.web.markup.toolbarbuttonextensions.md) | The toolbar button to extend.   |
| **left**           | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                                    | The left padding.               |
| **top**            | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                                    | The top padding.                |
| **right**          | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                                    | The right padding.              |
| **bottom**         | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                                    | The bottom padding.             |

**Returns:** [TToolBarButton](/api/wisej.web.markup/extensions/wisej.web.markup.toolbarbuttonextensions.md). The modified toolbar button.

### ![](/files/lIX317sDtMTZJBi9oSIx) Pushed\<TToolBarButton>(toolbarButton, pushed)

Sets the pushed state of the [ToolBarButton](/api/wisej.web/containers/toolbar/wisej.web.toolbarbutton.md).

| Parameter          | Type                                                                                           | Description                                      |
| ------------------ | ---------------------------------------------------------------------------------------------- | ------------------------------------------------ |
| **TToolBarButton** |                                                                                                | The type of the toolbar button.                  |
| **toolbarButton**  | [TToolBarButton](/api/wisej.web.markup/extensions/wisej.web.markup.toolbarbuttonextensions.md) | The toolbar button to extend.                    |
| **pushed**         | [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean)                                | A value indicating whether the button is pushed. |

**Returns:** [TToolBarButton](/api/wisej.web.markup/extensions/wisej.web.markup.toolbarbuttonextensions.md). The modified toolbar button.

### ![](/files/lIX317sDtMTZJBi9oSIx) SizeMode\<TToolBarButton>(toolbarButton, sizeMode)

Sets the size mode of the [ToolBarButton](/api/wisej.web/containers/toolbar/wisej.web.toolbarbutton.md).

| Parameter          | Type                                                                                           | Description                     |
| ------------------ | ---------------------------------------------------------------------------------------------- | ------------------------------- |
| **TToolBarButton** |                                                                                                | The type of the toolbar button. |
| **toolbarButton**  | [TToolBarButton](/api/wisej.web.markup/extensions/wisej.web.markup.toolbarbuttonextensions.md) | The toolbar button to extend.   |
| **sizeMode**       | [ToolBarButtonSizeMode](/api/wisej.web/containers/toolbar/wisej.web.toolbarbuttonsizemode.md)  | The size mode to set.           |

**Returns:** [TToolBarButton](/api/wisej.web.markup/extensions/wisej.web.markup.toolbarbuttonextensions.md). The modified toolbar button.

### ![](/files/lIX317sDtMTZJBi9oSIx) Style\<TToolBarButton>(toolbarButton, style)

Sets the style of the [ToolBarButton](/api/wisej.web/containers/toolbar/wisej.web.toolbarbutton.md).

| Parameter          | Type                                                                                           | Description                     |
| ------------------ | ---------------------------------------------------------------------------------------------- | ------------------------------- |
| **TToolBarButton** |                                                                                                | The type of the toolbar button. |
| **toolbarButton**  | [TToolBarButton](/api/wisej.web.markup/extensions/wisej.web.markup.toolbarbuttonextensions.md) | The toolbar button to extend.   |
| **style**          | [ToolBarButtonStyle](/api/wisej.web/containers/toolbar/wisej.web.toolbarbuttonstyle.md)        | The style to set.               |

**Returns:** [TToolBarButton](/api/wisej.web.markup/extensions/wisej.web.markup.toolbarbuttonextensions.md). The modified toolbar button.

### ![](/files/lIX317sDtMTZJBi9oSIx) Tag\<TToolBarButton>(toolbarButton, obj)

Sets the tag object of the [ToolBarButton](/api/wisej.web/containers/toolbar/wisej.web.toolbarbutton.md).

| Parameter          | Type                                                                                           | Description                     |
| ------------------ | ---------------------------------------------------------------------------------------------- | ------------------------------- |
| **TToolBarButton** |                                                                                                | The type of the toolbar button. |
| **toolbarButton**  | [TToolBarButton](/api/wisej.web.markup/extensions/wisej.web.markup.toolbarbuttonextensions.md) | The toolbar button to extend.   |
| **obj**            | [Object](https://docs.microsoft.com/dotnet/api/system.object)                                  | The object to set as the tag.   |

**Returns:** [TToolBarButton](/api/wisej.web.markup/extensions/wisej.web.markup.toolbarbuttonextensions.md). The modified toolbar button.

### ![](/files/lIX317sDtMTZJBi9oSIx) Text\<TToolBarButton>(toolbarButton, text)

Sets the text of the [ToolBarButton](/api/wisej.web/containers/toolbar/wisej.web.toolbarbutton.md).

| Parameter          | Type                                                                                           | Description                     |
| ------------------ | ---------------------------------------------------------------------------------------------- | ------------------------------- |
| **TToolBarButton** |                                                                                                | The type of the toolbar button. |
| **toolbarButton**  | [TToolBarButton](/api/wisej.web.markup/extensions/wisej.web.markup.toolbarbuttonextensions.md) | The toolbar button to extend.   |
| **text**           | [String](https://docs.microsoft.com/dotnet/api/system.string)                                  | The text to set.                |

**Returns:** [TToolBarButton](/api/wisej.web.markup/extensions/wisej.web.markup.toolbarbuttonextensions.md). The modified toolbar button.

### ![](/files/lIX317sDtMTZJBi9oSIx) Text\<TToolBarButton>(toolbarButton, visible)

Sets the visibility of the [ToolBarButton](/api/wisej.web/containers/toolbar/wisej.web.toolbarbutton.md).

| Parameter          | Type                                                                                           | Description                                       |
| ------------------ | ---------------------------------------------------------------------------------------------- | ------------------------------------------------- |
| **TToolBarButton** |                                                                                                | The type of the toolbar button.                   |
| **toolbarButton**  | [TToolBarButton](/api/wisej.web.markup/extensions/wisej.web.markup.toolbarbuttonextensions.md) | The toolbar button to extend.                     |
| **visible**        | [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean)                                | A value indicating whether the button is visible. |

**Returns:** [TToolBarButton](/api/wisej.web.markup/extensions/wisej.web.markup.toolbarbuttonextensions.md). The modified toolbar button.

### ![](/files/lIX317sDtMTZJBi9oSIx) ToolTipText\<TToolBarButton>(toolbarButton, toolTipText)

Sets the tooltip text of the [ToolBarButton](/api/wisej.web/containers/toolbar/wisej.web.toolbarbutton.md).

| Parameter          | Type                                                                                           | Description                     |
| ------------------ | ---------------------------------------------------------------------------------------------- | ------------------------------- |
| **TToolBarButton** |                                                                                                | The type of the toolbar button. |
| **toolbarButton**  | [TToolBarButton](/api/wisej.web.markup/extensions/wisej.web.markup.toolbarbuttonextensions.md) | The toolbar button to extend.   |
| **toolTipText**    | [String](https://docs.microsoft.com/dotnet/api/system.string)                                  | The tooltip text to set.        |

**Returns:** [TToolBarButton](/api/wisej.web.markup/extensions/wisej.web.markup.toolbarbuttonextensions.md). The modified toolbar button.


---

# 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.markup/extensions/wisej.web.markup.toolbarbuttonextensions.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.
