# ComponentTool

Namespace: **Wisej.Web**

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

* [Component](https://docs.wisej.com/api/wisej.base/general/wisej.base.component)
  * [ComponentTool](https://docs.wisej.com/api/wisej.web/editors/wisej.web.componenttool)

Represent a tool widget that can be displayed inside another control. A tool widget is different from other child controls: it's displayed inside the parent's layout. For example, the [Form](https://docs.wisej.com/api/wisej.web/containers/form) control shows tool widgets inside the caption bar. When a tool widget is pressed, it fires the toolClicked event on the container.

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

```csharp
public class ComponentTool : Component
```

{% endtab %}

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

```visual-basic
Public Class ComponentTool
    Inherits Component
```

{% endtab %}
{% endtabs %}

## Constructors

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

Initializes a new instance of the [ComponentTool](https://docs.wisej.com/api/wisej.web/editors/wisej.web.componenttool) class.

## Properties

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

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns or sets whether the [ComponentTool](https://docs.wisej.com/api/wisej.web/editors/wisej.web.componenttool) automatically hides itself when the host control loses the focus. (Default: `False`)

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

[Control](https://docs.wisej.com/api/wisej.web/general/control): Returns the [Control](#control) that contains this [ComponentTool](https://docs.wisej.com/api/wisej.web/editors/wisej.web.componenttool) object.

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

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns or sets whether the [ComponentTool](https://docs.wisej.com/api/wisej.web/editors/wisej.web.componenttool) is enabled.

The tool can be forced enabled or disabled by assigning the [Enabled](#enabled) property. Use [ResetEnabled](#resetenabled) to reset this property to inherit from the container.\
If this property is not assigned, the tool will inherit the enabled state from the container [Control](#control). By assigning this property, you can force the tool to be enabled when the container is disabled and vice versa.

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

[Image](https://docs.microsoft.com/dotnet/api/system.drawing.image): Returns or sets the image that is displayed in a [ComponentTool](https://docs.wisej.com/api/wisej.web/editors/wisej.web.componenttool) button.

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

[String](https://docs.microsoft.com/dotnet/api/system.string): Returns or sets the theme name or URL for the image to display in the [ComponentTool](https://docs.wisej.com/api/wisej.web/editors/wisej.web.componenttool) button.

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

[String](https://docs.microsoft.com/dotnet/api/system.string): Returns or sets the name to apply to the [ComponentTool](https://docs.wisej.com/api/wisej.web/editors/wisej.web.componenttool). (Default: `""`)

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

[LeftRightAlignment](https://docs.wisej.com/api/wisej.web/enumerations/wisej.web.leftrightalignment): Returns or sets the horizontal alignment of this [ComponentTool](https://docs.wisej.com/api/wisej.web/editors/wisej.web.componenttool) within the parent's container. (Default: `Right`)

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

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns or sets whether a toggle-style [ComponentTool](https://docs.wisej.com/api/wisej.web/editors/wisej.web.componenttool) is currently in the pushed state. (Default: `False`)

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

[String](https://docs.microsoft.com/dotnet/api/system.string): Returns or sets ToolTip text associated with the [ComponentTool](https://docs.wisej.com/api/wisej.web/editors/wisej.web.componenttool) button. (Default: `""`)

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

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns or sets whether the [ComponentTool](https://docs.wisej.com/api/wisej.web/editors/wisej.web.componenttool) is visible. (Default: `True`)

## Methods

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-9bf7fa01e02f4da0f9ef90d3b049ae43e664919e%2Fprotected.png?alt=media) Dispose(disposing)

Marks this component as disposed.

| 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. |

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-9bf7fa01e02f4da0f9ef90d3b049ae43e664919e%2Fprotected.png?alt=media) OnWebRender(config)

Renders the client component.

| Parameter  | Type                                                          | Description                   |
| ---------- | ------------------------------------------------------------- | ----------------------------- |
| **config** | [Object](https://docs.microsoft.com/dotnet/api/system.object) | Dynamic configuration object. |

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

Resets the [Enabled](#enabled) property to inherit the enabled state from the container [Control](#control).

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

Updates the component on the client. Overridden to repaint the widget in design mode.

## Implements

| Name                                                                                                 | Description                                                                                                     |
| ---------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
| [IUserData](https://docs.wisej.com/api/wisej.web/interfaces/wisej.web.iuserdata)                     | Provides access to the `UserData` and `Tag` properties associated to the component implementing this interface. |
| [IWisejComponent](https://docs.wisej.com/api/wisej.core/interfaces/wisej.core.iwisejcomponent)       | All wisej components implement this interface.                                                                  |
| [IWisejSerializable](https://docs.wisej.com/api/wisej.core/interfaces/wisej.core.iwisejserializable) | Allows an object to serialize itself.                                                                           |
