# GUILayout.VerticalScope

> Disposable helper class for managing GUILayout.BeginVertical / GUILayout.EndVertical.

## Definition

* **Type:** Class
* **Namespace:** [UnityEngine](/engine/6000.5/script-reference/unityengine.md)
* **Assembly:** UnityEngine.IMGUIModule
* **Inherits from:** Scope
* **Implements:** [IDisposable](https://learn.microsoft.com/dotnet/api/system.idisposable)

```csharp
public class GUILayout.VerticalScope : GUI.Scope, IDisposable
```

## Remarks

All controls rendered inside this element will be placed vertically below each other. The group is automatically closed when the scope ends.

![GUILayoutVertical (GUILayout.VerticalScope)](/api/media?file=/engine/6000.5/media/images/GUILayoutVertical.png)

*Vertical Layout.*

## Examples

```csharp
using UnityEngine;

public class ExampleClass : MonoBehaviour
{
    void OnGUI()
    {
        // Starts a vertical group
        using (var verticalScope = new VerticalScope("box"))
        {
            GUILayout.Button("I'm the top button");
            GUILayout.Button("I'm the bottom button");
        }
        // The group is now ended
    }
}
```

## Constructors

| Constructor                                                                                                                                                                                                                    | Description                                                            |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------- |
| [VerticalScope(System.String,UnityEngine.GUIStyle,UnityEngine.GUILayoutOption\[\])](/engine/6000.5/script-reference/unityengine/guilayout/verticalscope/ctor.md#verticalscope\(string-guistyle-guilayoutoption\))              | Create a new VerticalScope and begin the corresponding vertical group. |
| [VerticalScope(UnityEngine.GUIContent,UnityEngine.GUIStyle,UnityEngine.GUILayoutOption\[\])](/engine/6000.5/script-reference/unityengine/guilayout/verticalscope/ctor.md#verticalscope\(guicontent-guistyle-guilayoutoption\)) | Create a new VerticalScope and begin the corresponding vertical group. |
| [VerticalScope(UnityEngine.GUILayoutOption\[\])](/engine/6000.5/script-reference/unityengine/guilayout/verticalscope/ctor.md#verticalscope\(guilayoutoption\))                                                                 | Create a new VerticalScope and begin the corresponding vertical group. |
| [VerticalScope(UnityEngine.GUIStyle,UnityEngine.GUILayoutOption\[\])](/engine/6000.5/script-reference/unityengine/guilayout/verticalscope/ctor.md#verticalscope\(guistyle-guilayoutoption\))                                   | Create a new VerticalScope and begin the corresponding vertical group. |
| [VerticalScope(UnityEngine.Texture,UnityEngine.GUIStyle,UnityEngine.GUILayoutOption\[\])](/engine/6000.5/script-reference/unityengine/guilayout/verticalscope/ctor.md#verticalscope\(texture-guistyle-guilayoutoption\))       | Create a new VerticalScope and begin the corresponding vertical group. |
