# TextBox

## Content



The Input TextBox allows users to enter text values in the control. Though it typically captures a single line of text, but can also be configured to capture multiple lines of text. The TextBox control serves the purpose of displaying and editing plain text.

## Set Watermark

Users can set the **PlaceHolder** property of C1TextBox class to get or set the textual place holder, which is displayed by the control to prompt the user for information.

![](https://cdn.mescius.io/document-site-files/images/2d49eac2-0942-4770-99ef-52b14e6815bd/images/textbox-input.png)

The code snippet below depicts the use of placeholder or watermark in TextBox control.

```xml
<c1:C1TextBox Placeholder = "Enter your name" HorizontalAlignment="Left" Margin="100,126,0,0" TextWrapping="Wrap"  Height="50" Width="400" ></c1:C1TextBox>
```

## Multi-line TextBox Input

The TextBox control lets users create multi-line versions of the control as shown in the snapshot by using the **AcceptsReturn** property, which set the value that determines whether the text box displays newline characters.

![](https://cdn.mescius.io/document-site-files/images/2d49eac2-0942-4770-99ef-52b14e6815bd/images/textbox-scrollbar.png)

The code snippet below depicts the multi-line behavior in TextBox control.

**xml**

```xml
<c1:C1TextBox Name="textBox"  AcceptsReturn="True" TextWrapping="Wrap" MaxHeight="172" Width="300" Header="Description" ScrollViewer.VerticalScrollBarVisibility="Auto"/>
```

**csharp**

```csharp
textBox.AcceptsReturn = true;
textBox.TextWrapping = TextWrapping.Wrap;
textBox.MaxHeight = 172;
textBox.Width = 300;
textBox.Header = "Description";
ScrollViewer.SetVerticalScrollBarVisibility(textBox, ScrollBarVisibility.Auto);
```

The TextBox with multi-line feature will grow vertically unless it is limited by **Height** or **MaxHeight** property. Also, scrolling using a scroll-wheel is automatically enabled when needed.