Class

# WebToolbarButton

<div class="rst-class">

forsearch

</div>

Toolbar

<div class="rst-class">

forsearch

</div>

ToolbarButton

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

## Description

A button control in a `WebToolbar</api/user_interface/web/webtoolbar>`.

## Properties

<div class="rst-class">

table-centered_columns_3_and_4

</div>

| Name                                | Type                                               | Read-Only | Shared |
|-------------------------------------|----------------------------------------------------|-----------|--------|
| `Badge<webtoolbarbutton.badge>`     | `String</api/data_types/string>`                   |           |        |
| `Caption<webtoolbarbutton.caption>` | `String</api/data_types/string>`                   |           |        |
| `Enabled<webtoolbarbutton.enabled>` | `Boolean</api/data_types/boolean>`                 |           |        |
| `Icon<webtoolbarbutton.icon>`       | `WebPicture</api/graphics/webpicture>`             |           |        |
| `Menu<webtoolbarbutton.menu>`       | `WebMenuItem</api/user_interface/web/webmenuitem>` |           |        |
| `Pressed<webtoolbarbutton.pressed>` | `Boolean</api/data_types/boolean>`                 |           |        |
| `Style<webtoolbarbutton.style>`     | `ButtonStyles<webtoolbarbutton.buttonstyles>`      |           |        |
| `Tag<webtoolbarbutton.tag>`         | `Variant</api/data_types/variant>`                 |           |        |
| `Tooltip<webtoolbarbutton.tooltip>` | `String</api/data_types/string>`                   |           |        |
| `Visible<webtoolbarbutton.visible>` | `Boolean</api/data_types/boolean>`                 |           |        |

## Methods

<div class="rst-class">

table-centered_column_4

</div>

| Name                                        | Parameters                                  | Returns | Shared |
|---------------------------------------------|---------------------------------------------|---------|--------|
| `Constructor<webtoolbarbutton.constructor>` | caption As `String</api/data_types/string>` |         |        |

## Enumerations

<div id="webtoolbarbutton.buttonstyles">

<div class="rst-class">

forsearch

</div>

</div>

WebToolbarButton.ButtonStyles

### ButtonStyles

> The various appearances a toolbar button can have.
>
> | Enum          | Description                                                                                                                                                                                                                                                                                                                                                                                                                                               |
> |---------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
> | FlexibleSpace | The <span class="title-ref">WebToolbarButton</span> is a variable-width space between WebToolbarButtons. It right-aligns the buttons to its right as the window is resized.                                                                                                                                                                                                                                                                               |
> | Label         | The <span class="title-ref">WebToolbarButton</span> is a standard `WebLabel</api/user_interface/web/weblabel>` control.                                                                                                                                                                                                                                                                                                                                   |
> | Menu          | The <span class="title-ref">WebToolbarButton</span> is a drop-down menu with a separate down arrow on its right. There is room for the caption and the icon. To specify the menu, assign it to the `Menu<webtoolbarbutton.menu>` property of the <span class="title-ref">WebToolbarButton</span> class. Handle the selected menu item in the `MenuSelected<webtoolbar.menuselected>` event of the `WebToolbar</api/user_interface/web/webtoolbar>` class. |
> | PushButton    | The <span class="title-ref">WebToolbarButton</span> is a pushbutton.                                                                                                                                                                                                                                                                                                                                                                                      |
> | SeparateMenu  | Same as the Menu type above. This is here for consistency with the desktop `DesktopToolbarButton.ButtonStyles<desktoptoolbarbutton.buttonstyles>` enumeration.                                                                                                                                                                                                                                                                                            |
> | Separator     | Not available for web projects.                                                                                                                                                                                                                                                                                                                                                                                                                           |
> | Space         | The <span class="title-ref">WebToolbarButton</span> is a fixed-width space between WebToolbarButtons.                                                                                                                                                                                                                                                                                                                                                     |
> | Toggle        | The <span class="title-ref">WebToolbarButton</span> is a button that toggles between its normal and depressed state. Pressing one changes the state of the other toggle buttons, effectively making them work similarly to RadioButtons.                                                                                                                                                                                                                  |

## Property descriptions

<div id="webtoolbarbutton.badge">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebToolbarButton.Badge

**Badge** As `String</api/data_types/string>`

> A small graphical element used to displayed additional information alongside the `WebToolbarItem</api/user_interface/web/webtoolbaritem>`.
>
> The text appears in white on a round rectangle with a red background.

<div id="webtoolbarbutton.caption">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebToolbarButton.Caption

**Caption** As `String</api/data_types/string>`

> The text that accompanies the `WebToolbarItem</api/user_interface/web/webtoolbaritem>` to indicate its purpose.

<div id="webtoolbarbutton.enabled">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebToolbarButton.Enabled

**Enabled** As `Boolean</api/data_types/boolean>`

> If `True</api/language/true>`, the item can be pressed. If `False</api/language/false>`, it cannot be.

<div id="webtoolbarbutton.icon">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebToolbarButton.Icon

**Icon** As `WebPicture</api/graphics/webpicture>`

> The `picture</api/graphics/webpicture>` that is associated with the `WebToolbarItem</api/user_interface/web/webtoolbaritem>`.

<div id="webtoolbarbutton.menu">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebToolbarButton.Menu

**Menu** As `WebMenuItem</api/user_interface/web/webmenuitem>`

> This property accepts a `WebMenuItem</api/user_interface/web/webmenuitem>` instance to display as a contextual menu when the button is pressed, or `Nil</api/language/nil>` to remove any associated contextual menu.

<div id="webtoolbarbutton.pressed">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebToolbarButton.Pressed

**Pressed** As `Boolean</api/data_types/boolean>`

> If `True</api/language/true>`, the button appears pressed.

<div id="webtoolbarbutton.style">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebToolbarButton.Style

**Style** As `ButtonStyles<webtoolbarbutton.buttonstyles>`

> The style or type of button.

<div id="webtoolbarbutton.tag">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebToolbarButton.Tag

**Tag** As `Variant</api/data_types/variant>`

> A hidden value associated with the `WebToolbarItem</api/user_interface/web/webtoolbaritem>`.
>
> Since this is a `Variant</api/data_types/variant>`, this can be used to associate any type of data, even an object, with the `WebToolbarItem</api/user_interface/web/webtoolbaritem>`.

<div id="webtoolbarbutton.tooltip">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebToolbarButton.Tooltip

**Tooltip** As `String</api/data_types/string>`

> A helpful message that describes the purpose of the `WebToolbarItem</api/user_interface/web/webtoolbaritem>`.

<div id="webtoolbarbutton.visible">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

WebToolbarButton.Visible

**Visible** As `Boolean</api/data_types/boolean>`

> Indicates whether or not the WebToolbarItem is visible.
>
> This property is useful when you need to hide/show WebToolbarItem's dynamically at runtime.

## Method descriptions

<div id="webtoolbarbutton.constructor">

<div class="rst-class">

forsearch

</div>

</div>

WebToolbarButton.Constructor

**Constructor**(caption As `String</api/data_types/string>`)

> Creates a new <span class="title-ref">WebToolbarButton</span> with the *caption* passed.

## Notes

This item is similar to a normal toolbar button on the desktop. Pressing a button fires the `Pressed<webtoolbar.pressed>` event. It can appear in a *pressed* style that makes it appear selected.

## Compatibility

|                       |     |
|-----------------------|-----|
| **Project Types**     | Web |
| **Operating Systems** | All |

<div class="seealso">

`WebToolbarItem</api/user_interface/web/webtoolbaritem>` parent class; `WebMenuItem</api/user_interface/web/webmenuitem>`, `WebToolbar</api/user_interface/web/webtoolbar>` classes.

</div>
