# LabelField

> Make a label field. (Useful for showing read-only info.)

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor](/engine/6000.0/script-reference/unityeditor.md)
* **Assembly:** UnityEditor

## LabelField(string, GUILayoutOption\[])

Make a label field. (Useful for showing read-only info.)

```csharp
public static void LabelField(string label, params GUILayoutOption[] options)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Label in front of the label field.**** (\[GUILayoutOption\[]]\(/engine/6000.0/script-reference/unityengine/guilayoutoption)): An optional list of layout options that specify extra layout properties. Any values passed in here will override settings defined by the style.\
&#x20;Additional Resources: [GUILayout.Width](/engine/6000.0/script-reference/unityengine/guilayout/width.md), [GUILayout.Height](/engine/6000.0/script-reference/unityengine/guilayout/height.md), [GUILayout.MinWidth](/engine/6000.0/script-reference/unityengine/guilayout/minwidth.md), [GUILayout.MaxWidth](/engine/6000.0/script-reference/unityengine/guilayout/maxwidth.md), [GUILayout.MinHeight](/engine/6000.0/script-reference/unityengine/guilayout/minheight.md), [GUILayout.MaxHeight](/engine/6000.0/script-reference/unityengine/guilayout/maxheight.md), [GUILayout.ExpandWidth](/engine/6000.0/script-reference/unityengine/guilayout/expandwidth.md), [GUILayout.ExpandHeight](/engine/6000.0/script-reference/unityengine/guilayout/expandheight.md).

### Remarks

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

*Shows a label in the editor (Label) with the seconds since the editor started (Label2).*

### Examples

```csharp
// Shows a label in the editor with the seconds since the editor started
using UnityEditor;
using UnityEngine;

public class LabelFieldExample : EditorWindow
{
    [MenuItem("Examples/Editor GUILayout Label Usage")]
    static void Init()
    {
        LabelFieldExample window = (LabelFieldExample)EditorWindow.GetWindow(typeof(LabelFieldExample), true, "My Empty Window");
        window.Show();
    }

    void OnGUI()
    {
        EditorGUILayout.LabelField("Time since start: ",
            EditorApplication.timeSinceStartup.ToString());
        this.Repaint();
    }
}
```

## LabelField(string, GUIStyle, GUILayoutOption\[])

Make a label field. (Useful for showing read-only info.)

```csharp
public static void LabelField(string label, GUIStyle style, params GUILayoutOption[] options)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Label in front of the label field.**** (\[GUIStyle]\(/engine/6000.0/script-reference/unityengine/guistyle)): **** (\[GUILayoutOption\[]]\(/engine/6000.0/script-reference/unityengine/guilayoutoption)): An optional list of layout options that specify extra layout properties. Any values passed in here will override settings defined by the style.\
&#x20;Additional Resources: [GUILayout.Width](/engine/6000.0/script-reference/unityengine/guilayout/width.md), [GUILayout.Height](/engine/6000.0/script-reference/unityengine/guilayout/height.md), [GUILayout.MinWidth](/engine/6000.0/script-reference/unityengine/guilayout/minwidth.md), [GUILayout.MaxWidth](/engine/6000.0/script-reference/unityengine/guilayout/maxwidth.md), [GUILayout.MinHeight](/engine/6000.0/script-reference/unityengine/guilayout/minheight.md), [GUILayout.MaxHeight](/engine/6000.0/script-reference/unityengine/guilayout/maxheight.md), [GUILayout.ExpandWidth](/engine/6000.0/script-reference/unityengine/guilayout/expandwidth.md), [GUILayout.ExpandHeight](/engine/6000.0/script-reference/unityengine/guilayout/expandheight.md).

### Remarks

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

*Shows a label in the editor (Label) with the seconds since the editor started (Label2).*

### Examples

```csharp
// Shows a label in the editor with the seconds since the editor started
using UnityEditor;
using UnityEngine;

public class LabelFieldExample : EditorWindow
{
    [MenuItem("Examples/Editor GUILayout Label Usage")]
    static void Init()
    {
        LabelFieldExample window = (LabelFieldExample)EditorWindow.GetWindow(typeof(LabelFieldExample), true, "My Empty Window");
        window.Show();
    }

    void OnGUI()
    {
        EditorGUILayout.LabelField("Time since start: ",
            EditorApplication.timeSinceStartup.ToString());
        this.Repaint();
    }
}
```

## LabelField(GUIContent, GUILayoutOption\[])

Make a label field. (Useful for showing read-only info.)

```csharp
public static void LabelField(GUIContent label, params GUILayoutOption[] options)
```

### Parameters

**** (\[GUIContent]\(/engine/6000.0/script-reference/unityengine/guicontent)): Label in front of the label field.**** (\[GUILayoutOption\[]]\(/engine/6000.0/script-reference/unityengine/guilayoutoption)): An optional list of layout options that specify extra layout properties. Any values passed in here will override settings defined by the style.\
&#x20;Additional Resources: [GUILayout.Width](/engine/6000.0/script-reference/unityengine/guilayout/width.md), [GUILayout.Height](/engine/6000.0/script-reference/unityengine/guilayout/height.md), [GUILayout.MinWidth](/engine/6000.0/script-reference/unityengine/guilayout/minwidth.md), [GUILayout.MaxWidth](/engine/6000.0/script-reference/unityengine/guilayout/maxwidth.md), [GUILayout.MinHeight](/engine/6000.0/script-reference/unityengine/guilayout/minheight.md), [GUILayout.MaxHeight](/engine/6000.0/script-reference/unityengine/guilayout/maxheight.md), [GUILayout.ExpandWidth](/engine/6000.0/script-reference/unityengine/guilayout/expandwidth.md), [GUILayout.ExpandHeight](/engine/6000.0/script-reference/unityengine/guilayout/expandheight.md).

### Remarks

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

*Shows a label in the editor (Label) with the seconds since the editor started (Label2).*

### Examples

```csharp
// Shows a label in the editor with the seconds since the editor started
using UnityEditor;
using UnityEngine;

public class LabelFieldExample : EditorWindow
{
    [MenuItem("Examples/Editor GUILayout Label Usage")]
    static void Init()
    {
        LabelFieldExample window = (LabelFieldExample)EditorWindow.GetWindow(typeof(LabelFieldExample), true, "My Empty Window");
        window.Show();
    }

    void OnGUI()
    {
        EditorGUILayout.LabelField("Time since start: ",
            EditorApplication.timeSinceStartup.ToString());
        this.Repaint();
    }
}
```

## LabelField(GUIContent, GUIStyle, GUILayoutOption\[])

Make a label field. (Useful for showing read-only info.)

```csharp
public static void LabelField(GUIContent label, GUIStyle style, params GUILayoutOption[] options)
```

### Parameters

**** (\[GUIContent]\(/engine/6000.0/script-reference/unityengine/guicontent)): Label in front of the label field.**** (\[GUIStyle]\(/engine/6000.0/script-reference/unityengine/guistyle)): **** (\[GUILayoutOption\[]]\(/engine/6000.0/script-reference/unityengine/guilayoutoption)): An optional list of layout options that specify extra layout properties. Any values passed in here will override settings defined by the style.\
&#x20;Additional Resources: [GUILayout.Width](/engine/6000.0/script-reference/unityengine/guilayout/width.md), [GUILayout.Height](/engine/6000.0/script-reference/unityengine/guilayout/height.md), [GUILayout.MinWidth](/engine/6000.0/script-reference/unityengine/guilayout/minwidth.md), [GUILayout.MaxWidth](/engine/6000.0/script-reference/unityengine/guilayout/maxwidth.md), [GUILayout.MinHeight](/engine/6000.0/script-reference/unityengine/guilayout/minheight.md), [GUILayout.MaxHeight](/engine/6000.0/script-reference/unityengine/guilayout/maxheight.md), [GUILayout.ExpandWidth](/engine/6000.0/script-reference/unityengine/guilayout/expandwidth.md), [GUILayout.ExpandHeight](/engine/6000.0/script-reference/unityengine/guilayout/expandheight.md).

### Remarks

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

*Shows a label in the editor (Label) with the seconds since the editor started (Label2).*

### Examples

```csharp
// Shows a label in the editor with the seconds since the editor started
using UnityEditor;
using UnityEngine;

public class LabelFieldExample : EditorWindow
{
    [MenuItem("Examples/Editor GUILayout Label Usage")]
    static void Init()
    {
        LabelFieldExample window = (LabelFieldExample)EditorWindow.GetWindow(typeof(LabelFieldExample), true, "My Empty Window");
        window.Show();
    }

    void OnGUI()
    {
        EditorGUILayout.LabelField("Time since start: ",
            EditorApplication.timeSinceStartup.ToString());
        this.Repaint();
    }
}
```

## LabelField(string, string, GUILayoutOption\[])

Make a label field. (Useful for showing read-only info.)

```csharp
public static void LabelField(string label, string label2, params GUILayoutOption[] options)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Label in front of the label field.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The label to show to the right.**** (\[GUILayoutOption\[]]\(/engine/6000.0/script-reference/unityengine/guilayoutoption)): An optional list of layout options that specify extra layout properties. Any values passed in here will override settings defined by the style.\
&#x20;Additional Resources: [GUILayout.Width](/engine/6000.0/script-reference/unityengine/guilayout/width.md), [GUILayout.Height](/engine/6000.0/script-reference/unityengine/guilayout/height.md), [GUILayout.MinWidth](/engine/6000.0/script-reference/unityengine/guilayout/minwidth.md), [GUILayout.MaxWidth](/engine/6000.0/script-reference/unityengine/guilayout/maxwidth.md), [GUILayout.MinHeight](/engine/6000.0/script-reference/unityengine/guilayout/minheight.md), [GUILayout.MaxHeight](/engine/6000.0/script-reference/unityengine/guilayout/maxheight.md), [GUILayout.ExpandWidth](/engine/6000.0/script-reference/unityengine/guilayout/expandwidth.md), [GUILayout.ExpandHeight](/engine/6000.0/script-reference/unityengine/guilayout/expandheight.md).

### Remarks

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

*Shows a label in the editor (Label) with the seconds since the editor started (Label2).*

### Examples

```csharp
// Shows a label in the editor with the seconds since the editor started
using UnityEditor;
using UnityEngine;

public class LabelFieldExample : EditorWindow
{
    [MenuItem("Examples/Editor GUILayout Label Usage")]
    static void Init()
    {
        LabelFieldExample window = (LabelFieldExample)EditorWindow.GetWindow(typeof(LabelFieldExample), true, "My Empty Window");
        window.Show();
    }

    void OnGUI()
    {
        EditorGUILayout.LabelField("Time since start: ",
            EditorApplication.timeSinceStartup.ToString());
        this.Repaint();
    }
}
```

## LabelField(string, string, GUIStyle, GUILayoutOption\[])

Make a label field. (Useful for showing read-only info.)

```csharp
public static void LabelField(string label, string label2, GUIStyle style, params GUILayoutOption[] options)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Label in front of the label field.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The label to show to the right.**** (\[GUIStyle]\(/engine/6000.0/script-reference/unityengine/guistyle)): **** (\[GUILayoutOption\[]]\(/engine/6000.0/script-reference/unityengine/guilayoutoption)): An optional list of layout options that specify extra layout properties. Any values passed in here will override settings defined by the style.\
&#x20;Additional Resources: [GUILayout.Width](/engine/6000.0/script-reference/unityengine/guilayout/width.md), [GUILayout.Height](/engine/6000.0/script-reference/unityengine/guilayout/height.md), [GUILayout.MinWidth](/engine/6000.0/script-reference/unityengine/guilayout/minwidth.md), [GUILayout.MaxWidth](/engine/6000.0/script-reference/unityengine/guilayout/maxwidth.md), [GUILayout.MinHeight](/engine/6000.0/script-reference/unityengine/guilayout/minheight.md), [GUILayout.MaxHeight](/engine/6000.0/script-reference/unityengine/guilayout/maxheight.md), [GUILayout.ExpandWidth](/engine/6000.0/script-reference/unityengine/guilayout/expandwidth.md), [GUILayout.ExpandHeight](/engine/6000.0/script-reference/unityengine/guilayout/expandheight.md).

### Remarks

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

*Shows a label in the editor (Label) with the seconds since the editor started (Label2).*

### Examples

```csharp
// Shows a label in the editor with the seconds since the editor started
using UnityEditor;
using UnityEngine;

public class LabelFieldExample : EditorWindow
{
    [MenuItem("Examples/Editor GUILayout Label Usage")]
    static void Init()
    {
        LabelFieldExample window = (LabelFieldExample)EditorWindow.GetWindow(typeof(LabelFieldExample), true, "My Empty Window");
        window.Show();
    }

    void OnGUI()
    {
        EditorGUILayout.LabelField("Time since start: ",
            EditorApplication.timeSinceStartup.ToString());
        this.Repaint();
    }
}
```

## LabelField(GUIContent, GUIContent, GUILayoutOption\[])

Make a label field. (Useful for showing read-only info.)

```csharp
public static void LabelField(GUIContent label, GUIContent label2, params GUILayoutOption[] options)
```

### Parameters

**** (\[GUIContent]\(/engine/6000.0/script-reference/unityengine/guicontent)): Label in front of the label field.**** (\[GUIContent]\(/engine/6000.0/script-reference/unityengine/guicontent)): The label to show to the right.**** (\[GUILayoutOption\[]]\(/engine/6000.0/script-reference/unityengine/guilayoutoption)): An optional list of layout options that specify extra layout properties. Any values passed in here will override settings defined by the style.\
&#x20;Additional Resources: [GUILayout.Width](/engine/6000.0/script-reference/unityengine/guilayout/width.md), [GUILayout.Height](/engine/6000.0/script-reference/unityengine/guilayout/height.md), [GUILayout.MinWidth](/engine/6000.0/script-reference/unityengine/guilayout/minwidth.md), [GUILayout.MaxWidth](/engine/6000.0/script-reference/unityengine/guilayout/maxwidth.md), [GUILayout.MinHeight](/engine/6000.0/script-reference/unityengine/guilayout/minheight.md), [GUILayout.MaxHeight](/engine/6000.0/script-reference/unityengine/guilayout/maxheight.md), [GUILayout.ExpandWidth](/engine/6000.0/script-reference/unityengine/guilayout/expandwidth.md), [GUILayout.ExpandHeight](/engine/6000.0/script-reference/unityengine/guilayout/expandheight.md).

### Remarks

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

*Shows a label in the editor (Label) with the seconds since the editor started (Label2).*

### Examples

```csharp
// Shows a label in the editor with the seconds since the editor started
using UnityEditor;
using UnityEngine;

public class LabelFieldExample : EditorWindow
{
    [MenuItem("Examples/Editor GUILayout Label Usage")]
    static void Init()
    {
        LabelFieldExample window = (LabelFieldExample)EditorWindow.GetWindow(typeof(LabelFieldExample), true, "My Empty Window");
        window.Show();
    }

    void OnGUI()
    {
        EditorGUILayout.LabelField("Time since start: ",
            EditorApplication.timeSinceStartup.ToString());
        this.Repaint();
    }
}
```

## LabelField(GUIContent, GUIContent, GUIStyle, GUILayoutOption\[])

Make a label field. (Useful for showing read-only info.)

```csharp
public static void LabelField(GUIContent label, GUIContent label2, GUIStyle style, params GUILayoutOption[] options)
```

### Parameters

**** (\[GUIContent]\(/engine/6000.0/script-reference/unityengine/guicontent)): Label in front of the label field.**** (\[GUIContent]\(/engine/6000.0/script-reference/unityengine/guicontent)): The label to show to the right.**** (\[GUIStyle]\(/engine/6000.0/script-reference/unityengine/guistyle)): **** (\[GUILayoutOption\[]]\(/engine/6000.0/script-reference/unityengine/guilayoutoption)): An optional list of layout options that specify extra layout properties. Any values passed in here will override settings defined by the style.\
&#x20;Additional Resources: [GUILayout.Width](/engine/6000.0/script-reference/unityengine/guilayout/width.md), [GUILayout.Height](/engine/6000.0/script-reference/unityengine/guilayout/height.md), [GUILayout.MinWidth](/engine/6000.0/script-reference/unityengine/guilayout/minwidth.md), [GUILayout.MaxWidth](/engine/6000.0/script-reference/unityengine/guilayout/maxwidth.md), [GUILayout.MinHeight](/engine/6000.0/script-reference/unityengine/guilayout/minheight.md), [GUILayout.MaxHeight](/engine/6000.0/script-reference/unityengine/guilayout/maxheight.md), [GUILayout.ExpandWidth](/engine/6000.0/script-reference/unityengine/guilayout/expandwidth.md), [GUILayout.ExpandHeight](/engine/6000.0/script-reference/unityengine/guilayout/expandheight.md).

### Remarks

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

*Shows a label in the editor (Label) with the seconds since the editor started (Label2).*

### Examples

```csharp
// Shows a label in the editor with the seconds since the editor started
using UnityEditor;
using UnityEngine;

public class LabelFieldExample : EditorWindow
{
    [MenuItem("Examples/Editor GUILayout Label Usage")]
    static void Init()
    {
        LabelFieldExample window = (LabelFieldExample)EditorWindow.GetWindow(typeof(LabelFieldExample), true, "My Empty Window");
        window.Show();
    }

    void OnGUI()
    {
        EditorGUILayout.LabelField("Time since start: ",
            EditorApplication.timeSinceStartup.ToString());
        this.Repaint();
    }
}
```
