# GroupBoxExtensions

Namespace: **Wisej.Web.Markup**

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

Adds [fluent markup](https://learn.microsoft.com/en-us/dotnet/communitytoolkit/maui/markup/markup) extension methods to the [GroupBox](https://docs.wisej.com/api/wisej.web/containers/wisej.web.groupbox) class.

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

```csharp
public class GroupBoxExtensions
```

{% endtab %}

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

```visual-basic
Public Class GroupBoxExtensions
```

{% endtab %}
{% endtabs %}

## Methods

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-e4f8ed47a52590951f725a10c269555e81d41d81%2Fstatic.png?alt=media) AllowHtml\<TGroupBox>(groupBox, value)

Sets the AllowHtml property of the specified [GroupBox](https://docs.wisej.com/api/wisej.web/containers/wisej.web.groupbox).

| Parameter     | Type                                                                                                    | Description                                                                                                                                                 |
| ------------- | ------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **TGroupBox** |                                                                                                         | The type of the group box, must inherit from [GroupBox](https://docs.wisej.com/api/wisej.web/containers/wisej.web.groupbox) and have an AllowHtml property. |
| **groupBox**  | [TGroupBox](https://docs.wisej.com/api/wisej.web.markup/extensions/wisej.web.markup.groupboxextensions) | The group box for which to set the AllowHtml property.                                                                                                      |
| **value**     | [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean)                                         | A boolean indicating whether HTML content is allowed in the group box.                                                                                      |

**Returns:** [TGroupBox](https://docs.wisej.com/api/wisej.web.markup/extensions/wisej.web.markup.groupboxextensions). The modified group box with the updated AllowHtml property.

This method allows you to enable or disable HTML content in the group box.

```csharp

myGroupBox.AllowHtml(true);

```

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-e4f8ed47a52590951f725a10c269555e81d41d81%2Fstatic.png?alt=media) AutoSizeMode\<TGroupBox>(groupBox, mode)

Sets the AutoSizeMode property of the specified [GroupBox](https://docs.wisej.com/api/wisej.web/containers/wisej.web.groupbox).

| Parameter     | Type                                                                                                    | Description                                                                                                                  |
| ------------- | ------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| **TGroupBox** |                                                                                                         | The type of the group box, must inherit from [GroupBox](https://docs.wisej.com/api/wisej.web/containers/wisej.web.groupbox). |
| **groupBox**  | [TGroupBox](https://docs.wisej.com/api/wisej.web.markup/extensions/wisej.web.markup.groupboxextensions) | The group box for which to set the AutoSizeMode property.                                                                    |
| **mode**      | [AutoSizeMode](https://docs.wisej.com/api/wisej.web/enumerations/wisej.web.autosizemode)                | The [AutoSizeMode](#autosizemode``1) to set for the group box.                                                               |

**Returns:** [TGroupBox](https://docs.wisej.com/api/wisej.web.markup/extensions/wisej.web.markup.groupboxextensions). The modified group box with the updated AutoSizeMode property.

This method allows you to specify the automatic sizing behavior of the group box.

```csharp

myGroupBox.AutoSizeMode(AutoSizeMode.GrowAndShrink);

```

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-e4f8ed47a52590951f725a10c269555e81d41d81%2Fstatic.png?alt=media) Checked\<TGroupBox>(groupBox, value)

Sets the Checked property of the specified [GroupBox](https://docs.wisej.com/api/wisej.web/containers/wisej.web.groupbox).

| Parameter     | Type                                                                                                    | Description                                                                                                                                              |
| ------------- | ------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **TGroupBox** |                                                                                                         | The type of the group box, must inherit from [GroupBox](https://docs.wisej.com/api/wisej.web/containers/wisej.web.groupbox) and have a Checked property. |
| **groupBox**  | [TGroupBox](https://docs.wisej.com/api/wisej.web.markup/extensions/wisej.web.markup.groupboxextensions) | The group box for which to set the Checked property.                                                                                                     |
| **value**     | [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean)                                         | A boolean indicating whether the group box is checked.                                                                                                   |

**Returns:** [TGroupBox](https://docs.wisej.com/api/wisej.web.markup/extensions/wisej.web.markup.groupboxextensions). The modified group box with the updated Checked property.

This method allows you to specify whether the group box is checked.

```csharp

myGroupBox.Checked(true);

```

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-e4f8ed47a52590951f725a10c269555e81d41d81%2Fstatic.png?alt=media) Collapsed\<TGroupBox>(groupBox, collapsed)

Sets the Collapsed property of the specified [GroupBox](https://docs.wisej.com/api/wisej.web/containers/wisej.web.groupbox).

| Parameter     | Type                                                                                                    | Description                                                                                                                                                |
| ------------- | ------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **TGroupBox** |                                                                                                         | The type of the group box, must inherit from [GroupBox](https://docs.wisej.com/api/wisej.web/containers/wisej.web.groupbox) and have a Collapsed property. |
| **groupBox**  | [TGroupBox](https://docs.wisej.com/api/wisej.web.markup/extensions/wisej.web.markup.groupboxextensions) | The group box for which to set the Collapsed property.                                                                                                     |
| **collapsed** | [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean)                                         | A boolean indicating whether the group box is collapsed.                                                                                                   |

**Returns:** [TGroupBox](https://docs.wisej.com/api/wisej.web.markup/extensions/wisej.web.markup.groupboxextensions). The modified group box with the updated Collapsed property.

This method allows you to specify whether the group box is collapsed.

```csharp

myGroupBox.Collapsed(true);

```

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-e4f8ed47a52590951f725a10c269555e81d41d81%2Fstatic.png?alt=media) OnCheckedChanged\<TGroupBox>(groupBox, action)

Attaches an event handler for the CheckedChanged event of the specified [GroupBox](https://docs.wisej.com/api/wisej.web/containers/wisej.web.groupbox).

| Parameter     | Type                                                                                                    | Description                                                                                                                                                  |
| ------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **TGroupBox** |                                                                                                         | The type of the group box, must inherit from [GroupBox](https://docs.wisej.com/api/wisej.web/containers/wisej.web.groupbox) and have a CheckedChanged event. |
| **groupBox**  | [TGroupBox](https://docs.wisej.com/api/wisej.web.markup/extensions/wisej.web.markup.groupboxextensions) | The group box to attach the event handler to.                                                                                                                |
| **action**    | [Action\<TGroupBox>](https://docs.microsoft.com/dotnet/api/system.action-1)                             | An action to execute when the checked state changes.                                                                                                         |

**Returns:** [TGroupBox](https://docs.wisej.com/api/wisej.web.markup/extensions/wisej.web.markup.groupboxextensions). The modified group box with the attached CheckedChanged event handler.

This method allows you to execute a custom action whenever the checked state of the group box changes.

```csharp

myGroupBox.OnCheckedChanged(gb =>
{
AlertBox.Show("Checked state changed!");
});

```

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-e4f8ed47a52590951f725a10c269555e81d41d81%2Fstatic.png?alt=media) OnGroupBoxCollapsed\<TGroupBox>(groupBox, action)

Attaches an event handler for the GroupBoxCollapsed event of the specified [GroupBox](https://docs.wisej.com/api/wisej.web/containers/wisej.web.groupbox).

| Parameter     | Type                                                                                                    | Description                                                                                                                                                     |
| ------------- | ------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **TGroupBox** |                                                                                                         | The type of the group box, must inherit from [GroupBox](https://docs.wisej.com/api/wisej.web/containers/wisej.web.groupbox) and have a GroupBoxCollapsed event. |
| **groupBox**  | [TGroupBox](https://docs.wisej.com/api/wisej.web.markup/extensions/wisej.web.markup.groupboxextensions) | The group box to attach the event handler to.                                                                                                                   |
| **action**    | [Action\<TGroupBox>](https://docs.microsoft.com/dotnet/api/system.action-1)                             | An action to execute when the group box is collapsed.                                                                                                           |

**Returns:** [TGroupBox](https://docs.wisej.com/api/wisej.web.markup/extensions/wisej.web.markup.groupboxextensions). The modified group box with the attached GroupBoxCollapsed event handler.

This method allows you to execute a custom action whenever the group box is collapsed.

```csharp

myGroupBox.OnGroupBoxCollapsed(gb =>
{
AlertBox.Show("Group box collapsed!");
});

```

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-e4f8ed47a52590951f725a10c269555e81d41d81%2Fstatic.png?alt=media) OnGroupBoxExpanded\<TGroupBox>(groupBox, action)

Attaches an event handler for the GroupBoxExpanded event of the specified [GroupBox](https://docs.wisej.com/api/wisej.web/containers/wisej.web.groupbox).

| Parameter     | Type                                                                                                    | Description                                                                                                                                                    |
| ------------- | ------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **TGroupBox** |                                                                                                         | The type of the group box, must inherit from [GroupBox](https://docs.wisej.com/api/wisej.web/containers/wisej.web.groupbox) and have a GroupBoxExpanded event. |
| **groupBox**  | [TGroupBox](https://docs.wisej.com/api/wisej.web.markup/extensions/wisej.web.markup.groupboxextensions) | The group box to attach the event handler to.                                                                                                                  |
| **action**    | [Action\<TGroupBox>](https://docs.microsoft.com/dotnet/api/system.action-1)                             | An action to execute when the group box is expanded.                                                                                                           |

**Returns:** [TGroupBox](https://docs.wisej.com/api/wisej.web.markup/extensions/wisej.web.markup.groupboxextensions). The modified group box with the attached GroupBoxExpanded event handler.

This method allows you to execute a custom action whenever the group box is expanded.

```csharp

myGroupBox.OnGroupBoxExpanded(gb =>
{
AlertBox.Show("Group box expanded!");
});

```

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-e4f8ed47a52590951f725a10c269555e81d41d81%2Fstatic.png?alt=media) RestoreBounds\<TGroupBox>(groupBox, bounds)

Sets the RestoreBounds property of the specified [GroupBox](https://docs.wisej.com/api/wisej.web/containers/wisej.web.groupbox).

| Parameter     | Type                                                                                                    | Description                                                                                                                                                    |
| ------------- | ------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **TGroupBox** |                                                                                                         | The type of the group box, must inherit from [GroupBox](https://docs.wisej.com/api/wisej.web/containers/wisej.web.groupbox) and have a RestoreBounds property. |
| **groupBox**  | [TGroupBox](https://docs.wisej.com/api/wisej.web.markup/extensions/wisej.web.markup.groupboxextensions) | The group box for which to set the RestoreBounds property.                                                                                                     |
| **bounds**    | [Rectangle](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle)                             | The [Rectangle](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle) to set for the restore bounds.                                                 |

**Returns:** [TGroupBox](https://docs.wisej.com/api/wisej.web.markup/extensions/wisej.web.markup.groupboxextensions). The modified group box with the updated RestoreBounds property.

This method allows you to specify the restore bounds of the group box.

```csharp

myGroupBox.RestoreBounds(new Rectangle(0, 0, 100, 100));

```

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-e4f8ed47a52590951f725a10c269555e81d41d81%2Fstatic.png?alt=media) RightToLeftLayout\<TGroupBox>(groupBox, value)

Sets the RightToLeftLayout property of the specified [GroupBox](https://docs.wisej.com/api/wisej.web/containers/wisej.web.groupbox).

| Parameter     | Type                                                                                                    | Description                                                                                                                  |
| ------------- | ------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| **TGroupBox** |                                                                                                         | The type of the group box, must inherit from [GroupBox](https://docs.wisej.com/api/wisej.web/containers/wisej.web.groupbox). |
| **groupBox**  | [TGroupBox](https://docs.wisej.com/api/wisej.web.markup/extensions/wisej.web.markup.groupboxextensions) | The group box for which to set the RightToLeftLayout property.                                                               |
| **value**     | [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean)                                         | A boolean indicating whether the layout is right-to-left.                                                                    |

**Returns:** [TGroupBox](https://docs.wisej.com/api/wisej.web.markup/extensions/wisej.web.markup.groupboxextensions). The modified group box with the updated RightToLeftLayout property.

This method allows you to specify whether the layout of the group box is right-to-left.

```csharp

myGroupBox.RightToLeftLayout(true);

```

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-e4f8ed47a52590951f725a10c269555e81d41d81%2Fstatic.png?alt=media) RightToLeftLayoutChanged\<TGroupBox>(groupBox, action)

Attaches an event handler for the RightToLeftLayoutChanged event of the specified [GroupBox](https://docs.wisej.com/api/wisej.web/containers/wisej.web.groupbox).

| Parameter     | Type                                                                                                    | Description                                                                                                                                                            |
| ------------- | ------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **TGroupBox** |                                                                                                         | The type of the group box, must inherit from [GroupBox](https://docs.wisej.com/api/wisej.web/containers/wisej.web.groupbox) and have a RightToLeftLayoutChanged event. |
| **groupBox**  | [TGroupBox](https://docs.wisej.com/api/wisej.web.markup/extensions/wisej.web.markup.groupboxextensions) | The group box to attach the event handler to.                                                                                                                          |
| **action**    | [Action\<TGroupBox>](https://docs.microsoft.com/dotnet/api/system.action-1)                             | An action to execute when the right-to-left layout changes.                                                                                                            |

**Returns:** [TGroupBox](https://docs.wisej.com/api/wisej.web.markup/extensions/wisej.web.markup.groupboxextensions). The modified group box with the attached RightToLeftLayoutChanged event handler.

This method allows you to execute a custom action whenever the right-to-left layout of the group box changes.

```csharp

myGroupBox.RightToLeftLayoutChanged(gb =>
{
AlertBox.Show("Right-to-left layout changed!");
});

```

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-e4f8ed47a52590951f725a10c269555e81d41d81%2Fstatic.png?alt=media) ShowCheckBox\<TGroupBox>(groupBox, value)

Sets the ShowCheckBox property of the specified [GroupBox](https://docs.wisej.com/api/wisej.web/containers/wisej.web.groupbox).

| Parameter     | Type                                                                                                    | Description                                                                                                                                                   |
| ------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **TGroupBox** |                                                                                                         | The type of the group box, must inherit from [GroupBox](https://docs.wisej.com/api/wisej.web/containers/wisej.web.groupbox) and have a ShowCheckBox property. |
| **groupBox**  | [TGroupBox](https://docs.wisej.com/api/wisej.web.markup/extensions/wisej.web.markup.groupboxextensions) | The group box for which to set the ShowCheckBox property.                                                                                                     |
| **value**     | [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean)                                         | A boolean indicating whether a checkbox is shown.                                                                                                             |

**Returns:** [TGroupBox](https://docs.wisej.com/api/wisej.web.markup/extensions/wisej.web.markup.groupboxextensions). The modified group box with the updated ShowCheckBox property.

This method allows you to specify whether the group box shows a checkbox.

```csharp

myGroupBox.ShowCheckBox(true);

```

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-e4f8ed47a52590951f725a10c269555e81d41d81%2Fstatic.png?alt=media) ShowCloseButton\<TGroupBox>(groupBox, value)

Sets the ShowCloseButton property of the specified [GroupBox](https://docs.wisej.com/api/wisej.web/containers/wisej.web.groupbox).

| Parameter     | Type                                                                                                    | Description                                                                                                                                                      |
| ------------- | ------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **TGroupBox** |                                                                                                         | The type of the group box, must inherit from [GroupBox](https://docs.wisej.com/api/wisej.web/containers/wisej.web.groupbox) and have a ShowCloseButton property. |
| **groupBox**  | [TGroupBox](https://docs.wisej.com/api/wisej.web.markup/extensions/wisej.web.markup.groupboxextensions) | The group box for which to set the ShowCloseButton property.                                                                                                     |
| **value**     | [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean)                                         | A boolean indicating whether the close button is shown.                                                                                                          |

**Returns:** [TGroupBox](https://docs.wisej.com/api/wisej.web.markup/extensions/wisej.web.markup.groupboxextensions). The modified group box with the updated ShowCloseButton property.

This method allows you to specify whether the group box shows a close button.

```csharp

myGroupBox.ShowCloseButton(true);

```

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-e4f8ed47a52590951f725a10c269555e81d41d81%2Fstatic.png?alt=media) UseMnemonic\<TGroupBox>(groupBox, value)

Sets the UseMnemonic property of the specified [GroupBox](https://docs.wisej.com/api/wisej.web/containers/wisej.web.groupbox).

| Parameter     | Type                                                                                                    | Description                                                                                                                  |
| ------------- | ------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| **TGroupBox** |                                                                                                         | The type of the group box, must inherit from [GroupBox](https://docs.wisej.com/api/wisej.web/containers/wisej.web.groupbox). |
| **groupBox**  | [TGroupBox](https://docs.wisej.com/api/wisej.web.markup/extensions/wisej.web.markup.groupboxextensions) | The group box for which to set the UseMnemonic property.                                                                     |
| **value**     | [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean)                                         | A boolean indicating whether mnemonic characters are used in the group box text.                                             |

**Returns:** [TGroupBox](https://docs.wisej.com/api/wisej.web.markup/extensions/wisej.web.markup.groupboxextensions). The modified group box with the updated UseMnemonic property.

This method allows you to enable or disable the use of mnemonic characters in the group box's text.

```csharp

myGroupBox.UseMnemonic(true);

```
