# TextBox

## Content



**Input** provides various properties for customizing the appearance and styling the Input control, so that you can generate the TextBox control as per your requirement and change the look and feel of the application you are creating.

## Appearance

With the appearance-related properties, you can change the fore-color, and add background image and layout to a TextBox.

![](https://cdn.mescius.io/document-site-files/images/287a0e06-68cb-453e-816c-125f892133e7/images/textbox-appearance.gif)

The code snippet below depicts how to enhance the appearance of the TexTbox control.

```csharp
// Change the appearance-related properties in TextBox
c1TextBox1.Font = new System.Drawing.Font("Rockwell Extra Bold", 11F, System.Drawing.FontStyle.Underline, System.Drawing.GraphicsUnit.Point);
c1TextBox1.ForeColor = System.Drawing.Color.RoyalBlue;
c1TextBox1.Icon = new C1.Framework.C1BitmapIcon(null, new System.Drawing.Size(16, 16), System.Drawing.Color.Transparent, Image.FromFile(@"resources\OIP (2).jpg"));
c1TextBox1.Location = new System.Drawing.Point(429, 433);
c1TextBox1.Placeholder = "Add text...";
c1TextBox1.Size = new System.Drawing.Size(162, 54);
```

## Styling

The [C1TextBox](/componentone/docs/win/online-input-net/) class provides the [BackColor](/componentone/docs/win/online-input-net/) and [ForeColor](/componentone/docs/win/online-input-net/) properties to set the background and foreground colors, respectively. Besides these, it also provides [the](/componentone/docs/win/online-input-net/) [Styles](/componentone/docs/win/online-input-net/) property to apply styling to different states of textbox such as Default, Disabled, Hot, HotPressed, and Pressed.

The following image showcases styling applied to the Button control.

![](https://cdn.mescius.io/document-site-files/images/287a0e06-68cb-453e-816c-125f892133e7/images/textbox-styling.gif)

To apply styling to the TextBox control, use the following code. Here, we apply styling to the control by setting background color, foreground color, font style, and borders.

```csharp
// Change the styling-related properties in TextBox
c1TextBox2.Location = new System.Drawing.Point(3, 87);
c1TextBox2.Placeholder = "Add text...";
c1TextBox2.Size = new System.Drawing.Size(125, 26);
c1TextBox2.Styles.Border = new C1.Framework.Thickness(2, 2, 2, 2);
c1TextBox2.Styles.Button.Default.BackColor = System.Drawing.Color.Bisque;
c1TextBox2.Styles.Button.Default.BorderColor = System.Drawing.Color.Crimson;
c1TextBox2.Styles.Default.BackColor = System.Drawing.Color.Bisque;
c1TextBox2.Styles.Default.BorderColor = System.Drawing.Color.Blue;
c1TextBox2.Styles.Default.ForeColor = System.Drawing.Color.Tomato;
c1TextBox2.Styles.Font = new System.Drawing.Font("Times New Roman", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
c1TextBox2.Styles.Hot.BackColor = System.Drawing.Color.Yellow;
```

Alternatively, you can set the type of border for TextBox using [BorderStyle](/componentone/docs/win/online-input-net/) property of the [C1TextBox](/componentone/docs/win/online-input-net/) class. The value of the property can be set using the **BorderStyle** enumeration, which includes options such as **None**, **FixedSingle**, and **Fixed3D**. By default, the border style property is set to **BorderStyle.FixedSingle**. The image below showcases TextBox with its border style set to **None**.

![C1Textbox-Bordersstyle-none](https://cdn.mescius.io/document-site-files/images/287a0e06-68cb-453e-816c-125f892133e7/images/c1textbox-borderstyle-none.png)

The below code snippet illustrates setting the border style for TextBox to **None**.

```csharp
c1TextBox1.BorderStyle = BorderStyle.None;
```