# GroupBox

Namespace: **Wisej.Web**

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

* [Control](/api/wisej.web/general/control.md)
  * [GroupBox](/api/wisej.web/containers/wisej.web.groupbox.md)

Represents a Wisej control that displays a frame around a group of controls with an optional caption.

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

```csharp
public class GroupBox : Control
```

{% endtab %}

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

```visual-basic
Public Class GroupBox
    Inherits Control
```

{% endtab %}
{% endtabs %}

## Constructors

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

Initializes a new instance of the [GroupBox](/api/wisej.web/containers/wisej.web.groupbox.md) class.

### ![](/files/hsR4ok3152WyAf8J2C1u) GroupBox(text, controls)

Initializes a new instance of the [GroupBox](/api/wisej.web/containers/wisej.web.groupbox.md) class with the specified text.

| Name         | Type                                                          | Description                                                                                            |
| ------------ | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ |
| **text**     | [String](https://docs.microsoft.com/dotnet/api/system.string) | The text to display on the [GroupBox](/api/wisej.web/containers/wisej.web.groupbox.md).                |
| **controls** | [Control\[\]](/api/wisej.web/general/control.md)              | An array of control objects to add to the [GroupBox](/api/wisej.web/containers/wisej.web.groupbox.md). |

### ![](/files/hsR4ok3152WyAf8J2C1u) GroupBox(text, location, size, controls)

Initializes a new instance of the [GroupBox](/api/wisej.web/containers/wisej.web.groupbox.md) class with the specified controls, text, and collapsed state.

| Name         | Type                                                                | Description                                                                                            |
| ------------ | ------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ |
| **text**     | [String](https://docs.microsoft.com/dotnet/api/system.string)       | The text to display on the [GroupBox](/api/wisej.web/containers/wisej.web.groupbox.md).                |
| **location** | [Point](https://docs.microsoft.com/dotnet/api/system.drawing.point) | Initial location.                                                                                      |
| **size**     | [Size](https://docs.microsoft.com/dotnet/api/system.drawing.size)   | Initial size.                                                                                          |
| **controls** | [Control\[\]](/api/wisej.web/general/control.md)                    | An array of control objects to add to the [GroupBox](/api/wisej.web/containers/wisej.web.groupbox.md). |

## Properties

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

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns or sets a value indicating that the control can display html in the Text property. (Default: `False`)

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

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

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

[AutoSizeMode](/api/wisej.web/enumerations/wisej.web.autosizemode.md): Returns or sets the mode by which the [Button](/api/wisej.web/buttons/button.md) automatically resizes itself. (Default: `GrowOnly`)

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

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Gets or sets whether the checkbox next to the group box title is checked or unchecked. (Default: `True`)

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

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

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

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

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

[Padding](/api/wisej.web/general/wisej.web.padding.md): Returns the [Padding](/api/wisej.web/general/wisej.web.padding.md) structure that contains the default padding settings for a [GroupBox](/api/wisej.web/containers/wisej.web.groupbox.md) control.

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

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

### ![](/files/hsR4ok3152WyAf8J2C1u) 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.md#righttoleft) is [Yes](/api/wisej.web/enumerations/wisej.web.righttoleft.md#fields) (Default: `False`)

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

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Gets or sets whether the group box shows a checkbox next to the text. (Default: `False`)

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

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns or sets a value that indicates the [GroupBox](/api/wisej.web/containers/wisej.web.groupbox.md) displays the open/close button next to the title. (Default: `False`)

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

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns or sets whether the first character that is preceded by an ampersand (&) is used as the mnemonic key of the control. (Default: `True`)

## Methods

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

Fires the [CheckedChanged](#checkedchanged) 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) OnControlAdded(e)

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

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

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

Fires the [GroupBoxCollapsed](#groupboxcollapsed) 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) OnGroupBoxExpanded(e)

Fires the [GroupBoxExpanded](#groupboxexpanded) 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) OnRightToLeftLayoutChanged(e)

Fires the [RightToLeftLayoutChanged](#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. |

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

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

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

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

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

Sets the specified bounds of the [GroupBox](/api/wisej.web/containers/wisej.web.groupbox.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)                 | The new [Height](/api/wisej.web/general/control.md#height) property value of the control.                |
| **specified** | [BoundsSpecified](/api/wisej.web/enumerations/wisej.web.boundsspecified.md) | A combination of the [BoundsSpecified](/api/wisej.web/enumerations/wisej.web.boundsspecified.md) values. |

## Events

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

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

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

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

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

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

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

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

## 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/containers/wisej.web.groupbox.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.
