# Panel

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

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

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

- Control
- ScrollableControl
- [Panel](/api/wisej.web/containers/wisej.web.panel)
Represents a collapsible panel with an optional header that contains a group of controls.

- C# - VB.NET

```csharp
public class Panel : ScrollableControl, IImage
```

```visual
Public Class Panel
    Inherits ScrollableControl
    Implements IImage
```

## Constructors

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

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

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

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

| Name | Type | Description | **controls** | Control[] | An array ofControl objects to be added to the panel. 

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

Initializes a new instance of the [Panel](/api/wisej.web/containers/wisej.web.panel) 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. 

## Properties

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

[PanelAutoShowMode](/api/wisej.web/enumerations/wisej.web.panelautoshowmode) : Returns or sets a value that indicates whether the collapsed panel is automatically expanded when the mouse hovers over the title bar. (Default: `OnClick` )

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

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean) : Returns or sets a value that indicates whether the control resizes based on its contents. (Default: `False` )

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

[AutoSizeMode](/api/wisej.web/enumerations/wisej.web.autosizemode) : Indicates the automatic sizing behavior of the control. (Default: `GrowOnly` )

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

[BorderStyle](/api/wisej.web/enumerations/wisej.web.borderstyle) : Indicates the border style for the control. (Default: `None` )

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

[Rectangle](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle) : Returns the client rectangle to use in the designer.

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

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean) : Returns or sets a value that indicates whether the [Panel](/api/wisej.web/containers/wisej.web.panel) is collapsed. (Default: `False` )

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

[Rectangle](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle) : Returns the collapsed bounds.

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

[HeaderPosition](/api/wisej.web/enumerations/wisej.web.headerposition) : Returns or sets a value that indicates to which side should the panel collapse. (Default: `Top` )

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

[Rectangle](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle) : Returns a rectangle that represents the dimensions of the [GroupBox](/api/wisej.web/containers/wisej.web.groupbox) .

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

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean) : Returns or sets whether the control can gain the focus. (Default: `False` )

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

[HorizontalAlignment](/api/wisej.web/enumerations/wisej.web.horizontalalignment) : Returns or sets the alignment of the header text in the [Panel](/api/wisej.web/containers/wisej.web.panel) control. (Default: `Left` )

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

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

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

[Color](https://docs.microsoft.com/dotnet/api/system.drawing.color) : Returns or sets the text color of the header of the panel.

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

[HeaderPosition](/api/wisej.web/enumerations/wisej.web.headerposition) : Returns or sets a value that indicates on which side to display the header when the header is visible. (Default: `Top` )

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

[Int32](https://docs.microsoft.com/dotnet/api/system.int32) : Returns or sets the size of the header. When the header is horizontal, the size if the height; when it's vertical, the size if the width. Set it to -1 to reset to the size set in the current theme.

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

[Image](https://docs.microsoft.com/dotnet/api/system.drawing.image) : Returns or sets the image that is displayed in the header of the panel.

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

[Int32](https://docs.microsoft.com/dotnet/api/system.int32) : Returns or sets the image list index value of the image in the [ImageList](/api/wisej.web/containers/wisej.web.panel#imagelist) displayed in the button control. (Default: `-1` )

**Throws:**

- [ArgumentOutOfRangeException](https://docs.microsoft.com/dotnet/api/system.argumentoutofrangeexception) The specified index is less than -1.

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

[String](https://docs.microsoft.com/dotnet/api/system.string) : Returns or sets the key accessor for the image in the [ImageList](/api/wisej.web/containers/wisej.web.panel#imagelist) displayed in the header of the panel. (Default: `""` )

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

ImageList : Returns or sets theImageList that contains the [Image](/api/wisej.web/containers/wisej.web.panel#image) displayed in the header of the panel control. (Default: `null` )

### ![Instance member](/img/api/instance.png) 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 header of the panel.

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

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean) : Returns if the panel's header is oriented vertically.

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

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean) : Enables or disables right-to-left layout when the value of [RightToLeft](/api/wisej.web/general/control/#righttoleft) is [Yes](/api/wisej.web/enumerations/wisej.web.righttoleft#fields) (Default: `False` )

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

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean) : Returns or sets a value that indicates the caption bar displays the close button to collapse or expand the panel. (Default: `True` )

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

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean) : Returns or sets a value that indicates whether the caption bar is visible. (Default: `False` )

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

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean) : Returns or sets whether the user can give the focus to this control using the TAB key and the [Focusable](/api/wisej.web/containers/wisej.web.panel#focusable) property is set to true. (Default: `False` )

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

[String](https://docs.microsoft.com/dotnet/api/system.string) : Returns or sets the title of the [Panel](/api/wisej.web/containers/wisej.web.panel) panel. (Default: `""` )

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

[ComponentToolCollection](/api/wisej.web/editors/wisej.web.componenttoolcollection) : Returns the instance of [ComponentToolCollection](/api/wisej.web/editors/wisej.web.componenttoolcollection) associated with this control.

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

[String](https://docs.microsoft.com/dotnet/api/system.string) : Returns or sets the ToolTip text for the header of the panel. (Default: `""` )

## Methods

### ![Protected member](/img/api/protected.png) Dispose(disposing)

| Parameter | Type | Description | **disposing** | [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean) | 

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

**Returns:**[String](https://docs.microsoft.com/dotnet/api/system.string) .

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

Fires the [FontChanged](/api/wisej.web/general/control/#fontchanged) 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) OnPanelCollapsed(e)

Fires the [PanelCollapsed](/api/wisej.web/containers/wisej.web.panel#panelcollapsed) 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) OnPanelExpanded(e)

Fires the [PanelExpanded](/api/wisej.web/containers/wisej.web.panel#panelexpanded) 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) OnRightToLeftLayoutChanged(e)

Fires the [RightToLeftLayoutChanged](/api/wisej.web/containers/wisej.web.panel#righttoleftlayoutchanged) 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) OnToolClick(e)

Fires the ToolClick event.

| Parameter | Type | Description | **e** | [ToolClickEventArgs](/api/wisej.web/editors/wisej.web.toolclickeventargs) | A [ToolClickEventArgs](/api/wisej.web/editors/wisej.web.toolclickeventargs) 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. 

### ![Protected member](/img/api/protected.png) SetBoundsCore(x, y, width, height, specified)

Sets the specified bounds of the [Panel](/api/wisej.web/containers/wisej.web.panel) control.

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

### ![Protected member](/img/api/protected.png) SizeFromClientSize(clientSize)

Converts the client size into the panel size.

| Parameter | Type | Description | **clientSize** | [Size](https://docs.microsoft.com/dotnet/api/system.drawing.size) | 

**Returns:**[Size](https://docs.microsoft.com/dotnet/api/system.drawing.size) .

## Events

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

[EventHandler](https://docs.microsoft.com/dotnet/api/system.eventhandler) Fired when the panel is collapsed.

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

[EventHandler](https://docs.microsoft.com/dotnet/api/system.eventhandler) Fired when the panel is expanded.

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

[EventHandler](https://docs.microsoft.com/dotnet/api/system.eventhandler) Fired when the value of the [RightToLeftLayout](/api/wisej.web/containers/wisej.web.panel#righttoleftlayout) property changes.

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

[ToolClickEventHandler](/api/wisej.web/editors/wisej.web.toolclickeventhandler) Fired when a [ComponentTool](/api/wisej.web/editors/wisej.web.componenttool) is clicked.

## Inherited By

| Name | Description | TableLayoutPanel | Represents a panel that dynamically lays out its contents in a grid composed of rows and columns. | [BindingNavigator](/api/wisej.web/data-binding/wisej.web.bindingnavigator) | Represents the navigation and manipulation user interface (UI) for controls that are bound to a data source. | FlowLayoutPanel | Represents a panel that dynamically arranges its controls horizontally or vertically in automatic rows or columns. | [SplitterPanel](/api/wisej.web/containers/splitcontainer/wisej.web.splitterpanel) | Creates a panel that is associated with aSplitContainer . | [TabPage](/api/wisej.web/containers/tabcontrol/wisej.web.tabpage) | Represents a single tab page in aTabControl . | [DataRepeaterItem](/api/wisej.web/containers/datarepeater/wisej.web.datarepeateritem) | Used by theDataRepeater control to display data at run time. | [AccordionPanel](/api/wisej.web/containers/accordion/wisej.web.accordionpanel) | Represents a panel in aAccordion control. | FlexLayoutPanel | Represents a panel that dynamically arranges its child controls. 

## 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. | [IImage](/api/wisej.web/interfaces/wisej.web.iimage) | Provides access to common image properties across the controls that 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.
