# ComponentTool

Namespace: **Wisej.Web**

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

* [Component](https://docs.wisej.com/api/v2.2/wisej.base/general/wisej.base.component)
  * [ComponentTool](https://docs.wisej.com/api/v2.2/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/v2.2/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://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)ComponentTool()

Initializes a new instance of the [ComponentTool](https://docs.wisej.com/api/v2.2/wisej.web/editors/wisej.web.componenttool) 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)AutoHide

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

### ![](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)Control

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

### ![](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)Enabled

[Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean): Returns or sets whether the [ComponentTool](https://docs.wisej.com/api/v2.2/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://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)Image

[Image](https://docs.microsoft.com/en-us/dotnet/api/system.drawing.image): Returns or sets the image that is displayed in a [ComponentTool](https://docs.wisej.com/api/v2.2/wisej.web/editors/wisej.web.componenttool) 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)ImageSource

[String](https://docs.microsoft.com/en-us/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/v2.2/wisej.web/editors/wisej.web.componenttool) 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)Name

[String](https://docs.microsoft.com/en-us/dotnet/api/system.string): Returns or sets the name to apply to the [ComponentTool](https://docs.wisej.com/api/v2.2/wisej.web/editors/wisej.web.componenttool).

### ![](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)Position

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

### ![](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)Pushed

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

### ![](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)ToolTipText

[String](https://docs.microsoft.com/en-us/dotnet/api/system.string): Returns or sets ToolTip text associated with the [ComponentTool](https://docs.wisej.com/api/v2.2/wisej.web/editors/wisej.web.componenttool) 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)Visible

[Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean): Returns or sets whether the [ComponentTool](https://docs.wisej.com/api/v2.2/wisej.web/editors/wisej.web.componenttool) is visible.

## 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)ResetEnabled()

Resets the [Enabled](#enabled) property to inherit the enabled state from the container [Control](#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)Update()

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

## Implements

| Name                                                                                                      | Description                                    |
| --------------------------------------------------------------------------------------------------------- | ---------------------------------------------- |
| [IWisejComponent](https://docs.wisej.com/api/v2.2/wisej.core/interfaces/wisej.core.iwisejcomponent)       | All wisej components implement this interface. |
| [IWisejSerializable](https://docs.wisej.com/api/v2.2/wisej.core/interfaces/wisej.core.iwisejserializable) | Allows an object to serialize itself.          |


---

# 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/v2.2/wisej.web/editors/wisej.web.componenttool.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.
