> For the complete documentation index, see [llms.txt](https://kinematicsoup.gitbook.io/reactor/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kinematicsoup.gitbook.io/reactor/api-reference/ks.reactor.client.unity.editor/ks.reactor.client.unity.editor.kstextbox.md).

# Class ksTextBox

Namespace: [KS.Reactor.Client.Unity.Editor](/reactor/api-reference/ks.reactor.client.unity.editor.md)\
Assembly: KSUnity-Source.dll

A text box element that detects enter key events and checks for text changes when it loses focus.

```csharp
public class ksTextBox
```

#### Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) ← [ksTextBox](/reactor/api-reference/ks.reactor.client.unity.editor/ks.reactor.client.unity.editor.kstextbox.md)

#### Derived

[ksPathBox](/reactor/api-reference/ks.reactor.client.unity.editor/ks.reactor.client.unity.editor.kspathbox.md)

#### Inherited Members

[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals\(system-object\)), [object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals\(system-object-system-object\)), [object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode), [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype), [object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), [object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Constructors

### ksTextBox(EditorWindow, string, string) <a href="#ks_reactor_client_unity_editor_kstextbox__ctor_unityeditor_editorwindow_system_string_system_string" id="ks_reactor_client_unity_editor_kstextbox__ctor_unityeditor_editorwindow_system_string_system_string"></a>

Constructor

```csharp
public ksTextBox(EditorWindow window, string label = "", string text = "")
```

#### Parameters

`window` EditorWindow

Window this element will be drawn in.

`label` [string](https://learn.microsoft.com/dotnet/api/system.string)

Label for the element.

`text` [string](https://learn.microsoft.com/dotnet/api/system.string)

Initial text in the text box.

## Properties

### Focused <a href="#ks_reactor_client_unity_editor_kstextbox_focused" id="ks_reactor_client_unity_editor_kstextbox_focused"></a>

True if this text box has focus.

```csharp
public bool Focused { get; }
```

#### Property Value

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### Label <a href="#ks_reactor_client_unity_editor_kstextbox_label" id="ks_reactor_client_unity_editor_kstextbox_label"></a>

Label

```csharp
public string Label { get; set; }
```

#### Property Value

[string](https://learn.microsoft.com/dotnet/api/system.string)

### Text <a href="#ks_reactor_client_unity_editor_kstextbox_text" id="ks_reactor_client_unity_editor_kstextbox_text"></a>

Text in the text box.

```csharp
public string Text { get; set; }
```

#### Property Value

[string](https://learn.microsoft.com/dotnet/api/system.string)

## Methods

### Draw() <a href="#ks_reactor_client_unity_editor_kstextbox_draw" id="ks_reactor_client_unity_editor_kstextbox_draw"></a>

Draws the text box.

```csharp
public virtual bool Draw()
```

#### Returns

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

True if enter was pressed or if focus was lost and the text changed since focus was received.

### Focus() <a href="#ks_reactor_client_unity_editor_kstextbox_focus" id="ks_reactor_client_unity_editor_kstextbox_focus"></a>

Focuses this text box.

```csharp
public void Focus()
```
