Users Pricing

articles

home / developersection / articles / textbox control in c#.net
TextBox Control in C#.Net

TextBox Control in C#.Net

Anonymous User 13018 24 Jan 2011 Updated 04 Mar 2020

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

Add text in TextBox
private void frmTextBoLoad(object sender, EventArgs e)
        {
            textBox1.Text= "Hello";
        }

Hello text will show in the TextBox when application run.

TextBox Control in C#.Net

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

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

 TextBox Control in C#.Net

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#


I am a content writter !


2 Comments


Markdown for AI

A clean, structured version of this page for AI assistants and LLMs.

Open .md