# EditorGUILayout.VerticalScope

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

## Definition

* **Type:** Class
* **Namespace:** [UnityEditor](/engine/6000.6/script-reference/unityeditor.md)
* **Assembly:** UnityEditor.CoreModule
* **Inherits from:** Scope
* **Implements:** [IDisposable](https://learn.microsoft.com/dotnet/api/system.idisposable)

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

## Remarks

This is an extension to [GUILayout.VerticalScope](/engine/6000.6/script-reference/unityengine/guilayout/verticalscope.md). It can be used for making compound controls

![BeginEndVerticalExample (EditorGUILayout.VerticalScope)](/api/media?file=/engine/6000.6/media/images/BeginEndVerticalExample.png)

*Vertical Compound group.*

## Examples

```csharp
using UnityEngine;
using UnityEditor;

// Create a Vertical Compound Button
class VerticalScopeExample : EditorWindow
{
    [MenuItem("Examples/Vertical scope usage")]
    static void Init()
    {
        var window = GetWindow<VerticalScopeExample>();
        window.Show();
    }

    void OnGUI()
    {
        using (var v = new EditorGUILayout.VerticalScope("Button"))
        {
            if (GUI.Button(v.rect, GUIContent.none))
                Debug.Log("Go here");
            GUILayout.Label("I'm inside the button");
            GUILayout.Label("So am I");
        }
    }
}
```

## Constructors

| Constructor                                                                                                                                                                                        | Description                                                            |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- |
| [VerticalScope(UnityEngine.GUILayoutOption\[\])](/engine/6000.6/script-reference/unityeditor/editorguilayout/verticalscope/ctor.md#verticalscope\(guilayoutoption\))                               | Create a new VerticalScope and begin the corresponding vertical group. |
| [VerticalScope(UnityEngine.GUIStyle,UnityEngine.GUILayoutOption\[\])](/engine/6000.6/script-reference/unityeditor/editorguilayout/verticalscope/ctor.md#verticalscope\(guistyle-guilayoutoption\)) | Create a new VerticalScope and begin the corresponding vertical group. |

## Properties

| Property                                                                                  | Description                     |
| ----------------------------------------------------------------------------------------- | ------------------------------- |
| [rect](/engine/6000.6/script-reference/unityeditor/editorguilayout/verticalscope/rect.md) | The rect of the vertical group. |
