# SlideBar

URL: https://docs.wisej.com/api/wisej.web/containers/wisej.web.slidebar

Version: 4.1
Namespace: **Wisej.Web**

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

- Control
- [SlideBar](/api/wisej.web/containers/wisej.web.slidebar)
Displays child controls vertically or horizontally in a scrollable container.

- C# - VB.NET

```csharp
public class SlideBar : Control
```

```visual
Public Class SlideBar
    Inherits Control
```

## Constructors

### ![Instance member](/img/api/instance.png) SlideBar()

Initializes a new instance of the [SlideBar](/api/wisej.web/containers/wisej.web.slidebar) class.

### ![Instance member](/img/api/instance.png) SlideBar(controls, orientation)

Initializes a new instance of the [SlideBar](/api/wisej.web/containers/wisej.web.slidebar) class with the specified settings.

| Name | Type | Description | **controls** | Control[] | An array ofControl objects to be added to the panel. | **orientation** | [Orientation](/api/wisej.web/enumerations/wisej.web.orientation) | Initial [Orientation](/api/wisej.web/containers/wisej.web.slidebar#orientation) value. 

### ![Instance member](/img/api/instance.png) SlideBar(location, size, controls, orientation)

Initializes a new instance of the [SlideBar](/api/wisej.web/containers/wisej.web.slidebar) class with the specified settings.

| Name | Type | Description | **location** | [Point](https://docs.microsoft.com/dotnet/api/system.drawing.point) | The location of the panel on its parent control. | **size** | [Size](https://docs.microsoft.com/dotnet/api/system.drawing.size) | The size of the panel. | **controls** | Control[] | An array ofControl objects to be added to the panel. | **orientation** | [Orientation](/api/wisej.web/enumerations/wisej.web.orientation) | Initial [Orientation](/api/wisej.web/containers/wisej.web.slidebar#orientation) value. 

## Properties

### ![Instance member](/img/api/instance.png) BorderStyle

[BorderStyle](/api/wisej.web/enumerations/wisej.web.borderstyle) : Returns or sets the type of border that is drawn around the [SlideBar](/api/wisej.web/containers/wisej.web.slidebar) control. (Default: `None` )

### ![Instance member](/img/api/instance.png) ButtonsBackColor

[Color](https://docs.microsoft.com/dotnet/api/system.drawing.color) : Returns or sets the background [Color](https://docs.microsoft.com/dotnet/api/system.drawing.color) of the scroll buttons.

The default background color is set in the theme color as "slidebarButtons".

### ![Instance member](/img/api/instance.png) HorizontalScroll

[HScrollProperties](/api/wisej.web/content/scrollbar/wisej.web.hscrollproperties) : Returns the properties associated with the horizontal scroll position.

### ![Instance member](/img/api/instance.png) HScroll

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean) : Returns whether the horizontal scroll buttons are visible.

### ![Instance member](/img/api/instance.png) LayoutEngine

LayoutEngine : Returns the control's layout engine.

### ![Instance member](/img/api/instance.png) Orientation

[Orientation](/api/wisej.web/enumerations/wisej.web.orientation) : Returns or sets the [Orientation](/api/wisej.web/enumerations/wisej.web.orientation) of the [SlideBar](/api/wisej.web/containers/wisej.web.slidebar) control. (Default: `Horizontal` )

### ![Instance member](/img/api/instance.png) ScrollStep

[Int32](https://docs.microsoft.com/dotnet/api/system.int32) : Returns or sets the number of pixels to scroll when the scroll buttons are pressed. (Default: `15` )

**Throws:**

- [ArgumentOutOfRangeException](https://docs.microsoft.com/dotnet/api/system.argumentoutofrangeexception) The value is less than 1 or greater than 32000.

### ![Instance member](/img/api/instance.png) Spacing

[Int32](https://docs.microsoft.com/dotnet/api/system.int32) : Returns or sets the spacing between the child controls. (Default: `0` )

**Throws:**

- [ArgumentOutOfRangeException](https://docs.microsoft.com/dotnet/api/system.argumentoutofrangeexception) The value is less than 0 or greater than 32000.

### ![Instance member](/img/api/instance.png) VerticalScroll

[VScrollProperties](/api/wisej.web/content/scrollbar/wisej.web.vscrollproperties) : Returns the properties associated with the vertical scroll position.

### ![Instance member](/img/api/instance.png) VScroll

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean) : Returns whether the vertical scroll buttons are visible.

## Methods

### ![Protected member](/img/api/protected.png) OnControlAdded(e)

Fires the [ControlAdded](/api/wisej.web/general/control/#controladded) event.

| Parameter | Type | Description | **e** | [ControlEventArgs](/api/wisej.web/containers/control/wisej.web.controleventargs) | A [ControlEventArgs](/api/wisej.web/containers/control/wisej.web.controleventargs) that contains the event data. 

### ![Protected member](/img/api/protected.png) OnOrientationChanged(e)

Fires the [OrientationChanged](/api/wisej.web/containers/wisej.web.slidebar#orientationchanged) 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. 

### ![Protected member](/img/api/protected.png) OnScroll(e)

Fires the [Scroll](/api/wisej.web/containers/wisej.web.slidebar#scroll) event.

| Parameter | Type | Description | **e** | [ScrollEventArgs](/api/wisej.web/content/scrollbar/wisej.web.scrolleventargs) | A [ScrollEventArgs](/api/wisej.web/content/scrollbar/wisej.web.scrolleventargs) that contains the event data. 

This event fires only if there is an handler attached to it. A simple overload of the On[Event] method in a derived class will not be invoked unless there is at least one handler attached to the event.

### ![Protected member](/img/api/protected.png) OnScrollAnimationEnd(e)

Fires the [ScrollAnimationEnd](/api/wisej.web/containers/wisej.web.slidebar#scrollanimationend) 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. 

This event fires only if there is an handler attached to it. A simple overload of the On[Event] method in a derived class will not be invoked unless there is at least one handler attached to the event.

### ![Protected member](/img/api/protected.png) OnScrollStepChanged(e)

Fires the [ScrollStepChanged](/api/wisej.web/containers/wisej.web.slidebar#scrollstepchanged) 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. 

### ![Protected member](/img/api/protected.png) OnSpacingChanged(e)

Fires the [SpacingChanged](/api/wisej.web/containers/wisej.web.slidebar#spacingchanged) 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. 

### ![Protected member](/img/api/protected.png) OnWebEvent(e)

Processes the event from the client.

| Parameter | Type | Description | **e** | WisejEventArgs | Event arguments. 

### ![Protected member](/img/api/protected.png) OnWebRender(config)

Renders the client component.

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

### ![Protected member](/img/api/protected.png) OnWebUpdate(state)

Updates the client component using the state information.

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

### ![Instance member](/img/api/instance.png) ScrollBy(offset, duration)

Scrolls the content by the specified *offset* in pixels.

| Parameter | Type | Description | **offset** | [Int32](https://docs.microsoft.com/dotnet/api/system.int32) | Number of pixels to scroll by. | **duration** | [Int32](https://docs.microsoft.com/dotnet/api/system.int32) | The time in milliseconds the scroll to should take. 

### ![Instance member](/img/api/instance.png) ScrollControlIntoView(control)

Scrolls the specified child *control* into view.

| Parameter | Type | Description | **control** | Control | The child control to scroll into view. 

### ![Instance member](/img/api/instance.png) ScrollControlIntoView(control, alignX)

Scrolls the specified child *control* into view. using the specified *alignX* preference.

| Parameter | Type | Description | **control** | Control | The child control to scroll into view. | **alignX** | [HorizontalAlignment](/api/wisej.web/enumerations/wisej.web.horizontalalignment) | Indicates the [HorizontalAlignment](/api/wisej.web/enumerations/wisej.web.horizontalalignment) preference. The final location of the control depends on the scrollable range and the available space. Note that [Center](/api/wisej.web/enumerations/wisej.web.horizontalalignment#fields) will not scroll the control to the center, but will instead scroll it into the closest visible location with the minimum movement. 

### ![Instance member](/img/api/instance.png) ScrollControlIntoView(control, alignY)

Scrolls the specified child *control* into view. using the specified *alignY* preference.

| Parameter | Type | Description | **control** | Control | The child control to scroll into view. | **alignY** | [VerticalAlignment](/api/wisej.web/enumerations/wisej.web.verticalalignment) | Indicates the [VerticalAlignment](/api/wisej.web/enumerations/wisej.web.verticalalignment) preference. The final location of the control depends on the scrollable range and the available space. Note that [Middle](/api/wisej.web/enumerations/wisej.web.verticalalignment#fields) will not scroll the control to the middle, but will instead scroll it into the closest visible location with the minimum movement. 

### ![Instance member](/img/api/instance.png) ScrollTo(position, duration)

Scrolls the content to the specified *position* in pixels.

| Parameter | Type | Description | **position** | [Int32](https://docs.microsoft.com/dotnet/api/system.int32) | The position in pixels to scroll to. | **duration** | [Int32](https://docs.microsoft.com/dotnet/api/system.int32) | The time in milliseconds the scroll to should take. 

## Events

### ![Instance member](/img/api/instance.png) OrientationChanged

[EventHandler](https://docs.microsoft.com/dotnet/api/system.eventhandler) Fired when the value of [Orientation](/api/wisej.web/containers/wisej.web.slidebar#orientation) changes.

### ![Instance member](/img/api/instance.png) Scroll

[ScrollEventHandler](/api/wisej.web/content/scrollbar/wisej.web.scrolleventhandler) Fired when the [SlideBar](/api/wisej.web/containers/wisej.web.slidebar) widget scrolls its content.

This event fires only if there is an handler attached to it. A simple overload of the On[Event] method in a derived class will not be invoked unless there is at least one handler attached to the event.

### ![Instance member](/img/api/instance.png) ScrollAnimationEnd

[EventHandler](https://docs.microsoft.com/dotnet/api/system.eventhandler) Fired when the control has completed the scrolling animation.

This event fires only if there is an handler attached to it. A simple overload of the On[Event] method in a derived class will not be invoked unless there is at least one handler attached to the event.

### ![Instance member](/img/api/instance.png) ScrollStepChanged

[EventHandler](https://docs.microsoft.com/dotnet/api/system.eventhandler) Fired when the value of [ScrollStep](/api/wisej.web/containers/wisej.web.slidebar#scrollstep) changes.

### ![Instance member](/img/api/instance.png) SpacingChanged

[EventHandler](https://docs.microsoft.com/dotnet/api/system.eventhandler) Fired when the value of [Spacing](/api/wisej.web/containers/wisej.web.slidebar#spacing) changes.

## Implements

| Name | Description | [IUserData](/api/wisej.web/interfaces/wisej.web.iuserdata) | Provides access to the `UserData` and `Tag` properties associated to the component implementing this interface. | [IBindableComponent](/api/wisej.web/data-binding/wisej.web.ibindablecomponent) | Bindable components implement this interface. | [IDropTarget](/api/wisej.web/interfaces/wisej.web.idroptarget) | Controls that support drag & drop operations implement this interface. | [IWisejComponent](/api/wisej.core/interfaces/wisej.core.iwisejcomponent) | All wisej components implement this interface. | [IWisejControl](/api/wisej.core/interfaces/wisej.core.iwisejcontrol) | All wisej controls derived from theControl class must implement this interface. | [IWisejSerializable](/api/wisej.core/interfaces/wisej.core.iwisejserializable) | Allows an object to serialize itself.
