# ExpandWidth(bool)

> Option passed to a control to allow or disallow horizontal expansion.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine](/engine/6000.0/script-reference/unityengine.md)
* **Assembly:** UnityEngine.IMGUIModule

```csharp
public static GUILayoutOption ExpandWidth(bool expand)
```

### Parameters

**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)):&#x20;

### Returns

| Type                                                                              | Description |
| --------------------------------------------------------------------------------- | ----------- |
| [GUILayoutOption](/engine/6000.0/script-reference/unityengine/guilayoutoption.md) |             |

### Remarks

If this is true, the enclosed UI elements can expand to fill the available horizontal width.

![ExpandWidth (ExpandWidth(bool))](/api/media?file=/engine/6000.0/media/images/ExpandWidth.png).

### Examples

```csharp
using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour
{
    void OnGUI()
    {
        GUILayout.BeginVertical();
        GUILayout.Button("Short Button", GUILayout.ExpandWidth(false));
        GUILayout.Button("Very very long Button");
        GUILayout.EndVertical();
    }
}
```
