# TrackBar

Namespace: **Wisej.Web**

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

* [Control](/api/wisej.web/general/control.md)
  * [TrackBar](/api/wisej.web/editors/wisej.web.trackbar.md)

Enables the user to choose between a range of values by sliding a small bar along another bar.

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

```csharp
public class TrackBar : Control, ISupportInitialize
```

{% endtab %}

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

```visual-basic
Public Class TrackBar
    Inherits Control
    Implements ISupportInitialize
```

{% endtab %}
{% endtabs %}

## Constructors

### ![](/files/hsR4ok3152WyAf8J2C1u) TrackBar()

Initializes a new instance of the [TrackBar](/api/wisej.web/editors/wisej.web.trackbar.md) class.

### ![](/files/hsR4ok3152WyAf8J2C1u) TrackBar(onValueChanged)

Initializes a new instance of the [TrackBar](/api/wisej.web/editors/wisej.web.trackbar.md) class with a specified initial value and an event handler for the ValueChanged event.

| Name               | Type                                                                                | Description                                                       |
| ------------------ | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
| **onValueChanged** | [Action\<Object, EventArgs>](https://docs.microsoft.com/dotnet/api/system.action-2) | An Action delegate to handle the ValueChanged event. Can be null. |

### ![](/files/hsR4ok3152WyAf8J2C1u) TrackBar(location, size, onValueChanged)

Initializes a new instance of the [TrackBar](/api/wisej.web/editors/wisej.web.trackbar.md) class with a specified location and size.

| Name               | Type                                                                                | Description                                                       |
| ------------------ | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
| **location**       | [Point](https://docs.microsoft.com/dotnet/api/system.drawing.point)                 | The location of the TrackBar on its parent control.               |
| **size**           | [Size](https://docs.microsoft.com/dotnet/api/system.drawing.size)                   | The size of the TrackBar.                                         |
| **onValueChanged** | [Action\<Object, EventArgs>](https://docs.microsoft.com/dotnet/api/system.action-2) | An Action delegate to handle the ValueChanged event. Can be null. |

## Properties

### ![](/files/hsR4ok3152WyAf8J2C1u) AutoSize

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns or sets whether the height or width of the track bar is being automatically sized. (Default: `True`)

### ![](/files/lzopMboA31bVq8UIcbT3) DefaultSize

[Size](https://docs.microsoft.com/dotnet/api/system.drawing.size): Returns the default size of the [TrackBar](/api/wisej.web/editors/wisej.web.trackbar.md).

### ![](/files/hsR4ok3152WyAf8J2C1u) LargeChange

[Int32](https://docs.microsoft.com/dotnet/api/system.int32): Returns or sets a value to be added to or subtracted from the [Value](#value) property when the scroll box is moved a large distance. (Default: `5`)

**Throws:**

* [ArgumentException](https://docs.microsoft.com/dotnet/api/system.argumentexception)\
  The assigned value is less than 0.

### ![](/files/hsR4ok3152WyAf8J2C1u) Maximum

[Int32](https://docs.microsoft.com/dotnet/api/system.int32): Returns or sets the upper limit of the range this [TrackBar](/api/wisej.web/editors/wisej.web.trackbar.md) is working with. (Default: `10`)

### ![](/files/hsR4ok3152WyAf8J2C1u) Minimum

[Int32](https://docs.microsoft.com/dotnet/api/system.int32): Returns or sets the lower limit of the range this [TrackBar](/api/wisej.web/editors/wisej.web.trackbar.md) is working with. (Default: `0`)

### ![](/files/hsR4ok3152WyAf8J2C1u) Orientation

[Orientation](/api/wisej.web/enumerations/wisej.web.orientation.md): Returns or sets a value indicating the horizontal or vertical orientation of the track bar. (Default: `Horizontal`)

### ![](/files/hsR4ok3152WyAf8J2C1u) ShowValue

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns or sets a flag indicating whether the value is displayed in a bubble control while the user is moving the knob. (Default: `True`)

The appearance key of the child bubble component is "bubble".

### ![](/files/hsR4ok3152WyAf8J2C1u) SmallChange

[Int32](https://docs.microsoft.com/dotnet/api/system.int32): Returns or sets the value added to or subtracted from the [Value](#value) property when the scroll box is moved a small distance. (Default: `1`)

### ![](/files/hsR4ok3152WyAf8J2C1u) TickFrequency

[Int32](https://docs.microsoft.com/dotnet/api/system.int32): Returns or sets a value that specifies the delta between ticks drawn on the control. (Default: `1`)

### ![](/files/hsR4ok3152WyAf8J2C1u) TickStyle

[TickStyle](/api/wisej.web/enumerations/wisej.web.tickstyle.md): Returns or sets a value indicating how to display the tick marks on the track bar. (Default: `BottomRight`)

### ![](/files/hsR4ok3152WyAf8J2C1u) Value

[Int32](https://docs.microsoft.com/dotnet/api/system.int32): Returns or sets a numeric value that represents the current position of the scroll box on the track bar. (Default: `0`)

**Throws:**

* [ArgumentException](https://docs.microsoft.com/dotnet/api/system.argumentexception)\
  The assigned value is less than the value of [Minimum](#minimum); or the assigned value is greater than the value of [Maximum](#maximum).

## Methods

### ![](/files/lzopMboA31bVq8UIcbT3) IsInputKey(keyData)

Handles special input keys, such as PAGE UP, PAGE DOWN, HOME, and END.

| Parameter   | Type                                                  | Description                                                              |
| ----------- | ----------------------------------------------------- | ------------------------------------------------------------------------ |
| **keyData** | [Keys](/api/wisej.web/enumerations/wisej.web.keys.md) | One of the [Keys](/api/wisej.web/enumerations/wisej.web.keys.md) values. |

**Returns:** [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean). true if the specified key is a regular input key; otherwise, false.

### ![](/files/lzopMboA31bVq8UIcbT3) OnScroll(e)

Fires the [Scroll](#scroll) event.

| Parameter | Type                                                                | Description                                                                                         |
| --------- | ------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
| **e**     | [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) | A [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) that contains the event data. |

### ![](/files/lzopMboA31bVq8UIcbT3) OnTextChanged(e)

Fires the [TextChanged](#textchanged) event.

| Parameter | Type                                                                | Description                                                                                           |
| --------- | ------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| **e**     | [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) | The [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) that contains the event data. |

### ![](/files/lzopMboA31bVq8UIcbT3) OnValueChanged(e)

Fires the [ValueChanged](#valuechanged) event.

| Parameter | Type                                                                | Description                                                                                           |
| --------- | ------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| **e**     | [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) | The [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) that contains the event data. |

### ![](/files/lzopMboA31bVq8UIcbT3) OnWebEvent(e)

Processes the event from the client.

| Parameter | Type                                                        | Description      |
| --------- | ----------------------------------------------------------- | ---------------- |
| **e**     | [WisejEventArgs](/api/wisej.core/general/wisejeventargs.md) | Event arguments. |

### ![](/files/lzopMboA31bVq8UIcbT3) OnWebRender(config)

Renders the client component.

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

### ![](/files/lzopMboA31bVq8UIcbT3) SetBoundsCore(x, y, width, height, specified)

Sets the specified bounds of the [ComboBox](/api/wisej.web/lists-and-grids/combobox.md) control.

| Parameter     | Type                                                                        | Description                                                                                              |
| ------------- | --------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
| **x**         | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                 | The new [Left](/api/wisej.web/general/control.md#left) property value of the control.                    |
| **y**         | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                 | The new [Top](/api/wisej.web/general/control.md#top) property value of the control.                      |
| **width**     | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                 | The new [Width](/api/wisej.web/general/control.md#width) property value of the control.                  |
| **height**    | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                 | Not used.                                                                                                |
| **specified** | [BoundsSpecified](/api/wisej.web/enumerations/wisej.web.boundsspecified.md) | A combination of the [BoundsSpecified](/api/wisej.web/enumerations/wisej.web.boundsspecified.md) values. |

### ![](/files/hsR4ok3152WyAf8J2C1u) SetRange(minValue, maxValue)

Sets the minimum and maximum values for a [TrackBar](/api/wisej.web/editors/wisej.web.trackbar.md).

| Parameter    | Type                                                        | Description                                    |
| ------------ | ----------------------------------------------------------- | ---------------------------------------------- |
| **minValue** | [Int32](https://docs.microsoft.com/dotnet/api/system.int32) | The lower limit of the range of the track bar. |
| **maxValue** | [Int32](https://docs.microsoft.com/dotnet/api/system.int32) | The upper limit of the range of the track bar. |

## Events

### ![](/files/hsR4ok3152WyAf8J2C1u) AutoSizeChanged

[EventHandler](https://docs.microsoft.com/dotnet/api/system.eventhandler) Fired when the value of the [AutoSize](#autosize) property changes.

### ![](/files/hsR4ok3152WyAf8J2C1u) Scroll

[EventHandler](https://docs.microsoft.com/dotnet/api/system.eventhandler) Fired when either a mouse or keyboard action moves the scroll box.

### ![](/files/hsR4ok3152WyAf8J2C1u) TextChanged

[EventHandler](https://docs.microsoft.com/dotnet/api/system.eventhandler) Fired when the [Text](#text) property changes.

### ![](/files/hsR4ok3152WyAf8J2C1u) ValueChanged

[EventHandler](https://docs.microsoft.com/dotnet/api/system.eventhandler) Fired when the [Value](#value) property of a track bar changes, either by movement of the scroll box or by manipulation in code.

## Implements

| Name                                                                              | Description                                                                                                           |
| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
| [IUserData](/api/wisej.web/interfaces/wisej.web.iuserdata.md)                     | Provides access to the `UserData` and `Tag` properties associated to the component implementing this interface.       |
| [IBindableComponent](/api/wisej.web/data-binding/wisej.web.ibindablecomponent.md) | Bindable components implement this interface.                                                                         |
| [IDropTarget](/api/wisej.web/interfaces/wisej.web.idroptarget.md)                 | Controls that support drag & drop operations implement this interface.                                                |
| [IWisejComponent](/api/wisej.core/interfaces/wisej.core.iwisejcomponent.md)       | All wisej components implement this interface.                                                                        |
| [IWisejControl](/api/wisej.core/interfaces/wisej.core.iwisejcontrol.md)           | All wisej controls derived from the [Control](/api/wisej.web/general/control.md) class must implement this interface. |
| [IWisejSerializable](/api/wisej.core/interfaces/wisej.core.iwisejserializable.md) | 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/wisej.web/editors/wisej.web.trackbar.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.
