# 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](/api/wisej.web/containers/wisej.web.groupbox.md) class.

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

```csharp
public class GroupBoxExtensions
```

{% endtab %}

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

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

{% endtab %}
{% endtabs %}

## Methods

### ![](/files/lIX317sDtMTZJBi9oSIx) AllowHtml\<TGroupBox>(groupBox, value)

Sets the AllowHtml property of the specified [GroupBox](/api/wisej.web/containers/wisej.web.groupbox.md).

| Parameter     | Type                                                                                 | Description                                                                                                                              |
| ------------- | ------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------- |
| **TGroupBox** |                                                                                      | The type of the group box, must inherit from [GroupBox](/api/wisej.web/containers/wisej.web.groupbox.md) and have an AllowHtml property. |
| **groupBox**  | [TGroupBox](/api/wisej.web.markup/extensions/wisej.web.markup.groupboxextensions.md) | 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](/api/wisej.web.markup/extensions/wisej.web.markup.groupboxextensions.md). 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);

```

### ![](/files/lIX317sDtMTZJBi9oSIx) AutoSizeMode\<TGroupBox>(groupBox, mode)

Sets the AutoSizeMode property of the specified [GroupBox](/api/wisej.web/containers/wisej.web.groupbox.md).

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

**Returns:** [TGroupBox](/api/wisej.web.markup/extensions/wisej.web.markup.groupboxextensions.md). 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);

```

### ![](/files/lIX317sDtMTZJBi9oSIx) Checked\<TGroupBox>(groupBox, value)

Sets the Checked property of the specified [GroupBox](/api/wisej.web/containers/wisej.web.groupbox.md).

| Parameter     | Type                                                                                 | Description                                                                                                                           |
| ------------- | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------- |
| **TGroupBox** |                                                                                      | The type of the group box, must inherit from [GroupBox](/api/wisej.web/containers/wisej.web.groupbox.md) and have a Checked property. |
| **groupBox**  | [TGroupBox](/api/wisej.web.markup/extensions/wisej.web.markup.groupboxextensions.md) | 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](/api/wisej.web.markup/extensions/wisej.web.markup.groupboxextensions.md). 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);

```

### ![](/files/lIX317sDtMTZJBi9oSIx) Collapsed\<TGroupBox>(groupBox, collapsed)

Sets the Collapsed property of the specified [GroupBox](/api/wisej.web/containers/wisej.web.groupbox.md).

| Parameter     | Type                                                                                 | Description                                                                                                                             |
| ------------- | ------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------- |
| **TGroupBox** |                                                                                      | The type of the group box, must inherit from [GroupBox](/api/wisej.web/containers/wisej.web.groupbox.md) and have a Collapsed property. |
| **groupBox**  | [TGroupBox](/api/wisej.web.markup/extensions/wisej.web.markup.groupboxextensions.md) | 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](/api/wisej.web.markup/extensions/wisej.web.markup.groupboxextensions.md). 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);

```

### ![](/files/lIX317sDtMTZJBi9oSIx) OnCheckedChanged\<TGroupBox>(groupBox, action)

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

| Parameter     | Type                                                                                 | Description                                                                                                                               |
| ------------- | ------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------- |
| **TGroupBox** |                                                                                      | The type of the group box, must inherit from [GroupBox](/api/wisej.web/containers/wisej.web.groupbox.md) and have a CheckedChanged event. |
| **groupBox**  | [TGroupBox](/api/wisej.web.markup/extensions/wisej.web.markup.groupboxextensions.md) | 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](/api/wisej.web.markup/extensions/wisej.web.markup.groupboxextensions.md). 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!");
});

```

### ![](/files/lIX317sDtMTZJBi9oSIx) OnGroupBoxCollapsed\<TGroupBox>(groupBox, action)

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

| Parameter     | Type                                                                                 | Description                                                                                                                                  |
| ------------- | ------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------- |
| **TGroupBox** |                                                                                      | The type of the group box, must inherit from [GroupBox](/api/wisej.web/containers/wisej.web.groupbox.md) and have a GroupBoxCollapsed event. |
| **groupBox**  | [TGroupBox](/api/wisej.web.markup/extensions/wisej.web.markup.groupboxextensions.md) | 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](/api/wisej.web.markup/extensions/wisej.web.markup.groupboxextensions.md). 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!");
});

```

### ![](/files/lIX317sDtMTZJBi9oSIx) OnGroupBoxExpanded\<TGroupBox>(groupBox, action)

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

| Parameter     | Type                                                                                 | Description                                                                                                                                 |
| ------------- | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------- |
| **TGroupBox** |                                                                                      | The type of the group box, must inherit from [GroupBox](/api/wisej.web/containers/wisej.web.groupbox.md) and have a GroupBoxExpanded event. |
| **groupBox**  | [TGroupBox](/api/wisej.web.markup/extensions/wisej.web.markup.groupboxextensions.md) | 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](/api/wisej.web.markup/extensions/wisej.web.markup.groupboxextensions.md). 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!");
});

```

### ![](/files/lIX317sDtMTZJBi9oSIx) RestoreBounds\<TGroupBox>(groupBox, bounds)

Sets the RestoreBounds property of the specified [GroupBox](/api/wisej.web/containers/wisej.web.groupbox.md).

| Parameter     | Type                                                                                 | Description                                                                                                                                 |
| ------------- | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------- |
| **TGroupBox** |                                                                                      | The type of the group box, must inherit from [GroupBox](/api/wisej.web/containers/wisej.web.groupbox.md) and have a RestoreBounds property. |
| **groupBox**  | [TGroupBox](/api/wisej.web.markup/extensions/wisej.web.markup.groupboxextensions.md) | 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](/api/wisej.web.markup/extensions/wisej.web.markup.groupboxextensions.md). 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));

```

### ![](/files/lIX317sDtMTZJBi9oSIx) RightToLeftLayout\<TGroupBox>(groupBox, value)

Sets the RightToLeftLayout property of the specified [GroupBox](/api/wisej.web/containers/wisej.web.groupbox.md).

| Parameter     | Type                                                                                 | Description                                                                                               |
| ------------- | ------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------- |
| **TGroupBox** |                                                                                      | The type of the group box, must inherit from [GroupBox](/api/wisej.web/containers/wisej.web.groupbox.md). |
| **groupBox**  | [TGroupBox](/api/wisej.web.markup/extensions/wisej.web.markup.groupboxextensions.md) | 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](/api/wisej.web.markup/extensions/wisej.web.markup.groupboxextensions.md). 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);

```

### ![](/files/lIX317sDtMTZJBi9oSIx) RightToLeftLayoutChanged\<TGroupBox>(groupBox, action)

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

| Parameter     | Type                                                                                 | Description                                                                                                                                         |
| ------------- | ------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| **TGroupBox** |                                                                                      | The type of the group box, must inherit from [GroupBox](/api/wisej.web/containers/wisej.web.groupbox.md) and have a RightToLeftLayoutChanged event. |
| **groupBox**  | [TGroupBox](/api/wisej.web.markup/extensions/wisej.web.markup.groupboxextensions.md) | 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](/api/wisej.web.markup/extensions/wisej.web.markup.groupboxextensions.md). 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!");
});

```

### ![](/files/lIX317sDtMTZJBi9oSIx) ShowCheckBox\<TGroupBox>(groupBox, value)

Sets the ShowCheckBox property of the specified [GroupBox](/api/wisej.web/containers/wisej.web.groupbox.md).

| Parameter     | Type                                                                                 | Description                                                                                                                                |
| ------------- | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ |
| **TGroupBox** |                                                                                      | The type of the group box, must inherit from [GroupBox](/api/wisej.web/containers/wisej.web.groupbox.md) and have a ShowCheckBox property. |
| **groupBox**  | [TGroupBox](/api/wisej.web.markup/extensions/wisej.web.markup.groupboxextensions.md) | 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](/api/wisej.web.markup/extensions/wisej.web.markup.groupboxextensions.md). 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);

```

### ![](/files/lIX317sDtMTZJBi9oSIx) ShowCloseButton\<TGroupBox>(groupBox, value)

Sets the ShowCloseButton property of the specified [GroupBox](/api/wisej.web/containers/wisej.web.groupbox.md).

| Parameter     | Type                                                                                 | Description                                                                                                                                   |
| ------------- | ------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------- |
| **TGroupBox** |                                                                                      | The type of the group box, must inherit from [GroupBox](/api/wisej.web/containers/wisej.web.groupbox.md) and have a ShowCloseButton property. |
| **groupBox**  | [TGroupBox](/api/wisej.web.markup/extensions/wisej.web.markup.groupboxextensions.md) | 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](/api/wisej.web.markup/extensions/wisej.web.markup.groupboxextensions.md). 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);

```

### ![](/files/lIX317sDtMTZJBi9oSIx) UseMnemonic\<TGroupBox>(groupBox, value)

Sets the UseMnemonic property of the specified [GroupBox](/api/wisej.web/containers/wisej.web.groupbox.md).

| Parameter     | Type                                                                                 | Description                                                                                               |
| ------------- | ------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------- |
| **TGroupBox** |                                                                                      | The type of the group box, must inherit from [GroupBox](/api/wisej.web/containers/wisej.web.groupbox.md). |
| **groupBox**  | [TGroupBox](/api/wisej.web.markup/extensions/wisej.web.markup.groupboxextensions.md) | 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](/api/wisej.web.markup/extensions/wisej.web.markup.groupboxextensions.md). 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);

```


---

# 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.markup/extensions/wisej.web.markup.groupboxextensions.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.
