# Container

This type represents an abstract container.

## Add﻿ <a href="#add" id="add"></a>

[<kbd><mark style="background-color:purple;">**Method**<mark style="background-color:purple;"></kbd>](#user-content-fn-1)[^1]

Adds a control to the container.

Arguments

| Name   | Type                                                             | Description     |
| ------ | ---------------------------------------------------------------- | --------------- |
| `ctrl` | [`Control`](https://lua2.fatality.win/api/instances/gui/control) | Control to add. |

**Returns**

Nothing.

**Example**

```lua
container:Add(my_control);
```

***

## Remove﻿ <a href="#remove" id="remove"></a>

[<kbd><mark style="background-color:purple;">**Method**<mark style="background-color:purple;"></kbd>](#user-content-fn-1)[^1]

Removes a control from the container.

**Arguments**

| Name   | Type                                                             | Description        |
| ------ | ---------------------------------------------------------------- | ------------------ |
| `ctrl` | [`Control`](https://lua2.fatality.win/api/instances/gui/control) | Control to remove. |

**Returns**

Nothing.

**Example**

```lua
container:Remove(my_control);
```

***

## Find﻿ <a href="#find" id="find"></a>

[<kbd><mark style="background-color:purple;">**Method**<mark style="background-color:purple;"></kbd>](#user-content-fn-1)[^1]

Finds a control by ID.

Arguments

| Name | Type     | Description |
| ---- | -------- | ----------- |
| `id` | `string` | Control ID. |

Returns

| Type                                                                    | Description                                                                    |
| ----------------------------------------------------------------------- | ------------------------------------------------------------------------------ |
| `<`[`Control`](https://lua2.fatality.win/api/instances/gui/control)`>?` | Casted control. Returns `nil` if the control was not found, or casting failed. |

Example

```lua
local some_cb = container:Find('some_cb');
```

[^1]: This field is a method and must be invoked using a colon (:)
