---
title: "TextBox Control in C#.Net"  
description: "The TextBox control is used to display or accept as input, a single line of text. Its control has additional functionality that is not found in the"  
author: "Anonymous User"  
published: 2011-01-24  
updated: 2020-03-04  
canonical: https://www.mindstick.com/articles/390/textbox-control-in-c-sharp-dot-net  
category: "c#"  
tags: ["c#"]  
reading_time: 2 minutes  

---

# TextBox Control in C#.Net

The TextBox control is used to display or accept as input, a single line of text. Its control has additional functionality that is not found in the standard Windows text box control, including multiline editing and password character masking.

**Drag and drop TextBox control** form toolbox on the window Form.

![TextBox Control in C#.Net](https://www.mindstick.com/mindstickarticle/95b0b2c8-acaf-403c-b471-4207f9dec95d/images/eba87f80-bd4d-44d6-a72a-216aa3502ffe.png)\

##### Add text in TextBox

```
private void frmTextBox_Load(object sender, EventArgs e)        {            textBox1.Text= "Hello";        }
```

Hello text will show in the TextBox when application run.

![TextBox Control in C#.Net](https://www.mindstick.com/mindstickarticle/95b0b2c8-acaf-403c-b471-4207f9dec95d/images/9f9b25be-66ec-4598-a6e1-d9ac879370b4.png)\

##### TextBox as Input Control

Write the code on button click and assign the text box value in text properties of label

```
private void button1_Click(object sender, EventArgs e)        {            //TextBoxtext will show in label on button click            label1.Text= textBox1.Text;        }
```

![TextBox Control in C#.Net](https://www.mindstick.com/mindstickarticle/95b0b2c8-acaf-403c-b471-4207f9dec95d/images/1aa38f11-2d8c-4663-bb7a-b03e122f2d54.png)

When you entered Text in TextBox and click submit button then entered text will show in Label.

![TextBox Control in C#.Net](https://www.mindstick.com/mindstickarticle/95b0b2c8-acaf-403c-b471-4207f9dec95d/images/dbf9b009-4258-42d0-9fc3-c751d974e34f.png)\

##### TextBox Properties

**CharacterCasing**: set Character Case

- **Normal** - The case of characters is left unchanged.
- **Lower** - Converts all characters to lowercase.
- **Upper** - Converts all characters to uppercase.

**Multiline:** Indicates whether this is a multiline TextBox control.

**PasswordChar**: Specifies the character used to mask characters of a password in a single-line TextBox control.

**ScrollBars:** Specifies which scroll bars should appear in a multiline TextBox control.

\

You should Read also this Article - **[Using ReportViewer in WinForms C#](https://www.mindstick.com/articles/1118/using-reportviewer-in-winforms-c-sharp)**

---

Original Source: https://www.mindstick.com/articles/390/textbox-control-in-c-sharp-dot-net

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
