Home » .Net » C#.Net » C#.Net Windows Development

TextBox.PasswordChar Property with Example in C#.Net

C#.Net - TextBox.PasswordChar Property with Example: Here we are going to learn about the PasswordChar property of TextBox Control in C#.Net Windows Application Development.
Submitted by IncludeHelp, on September 03, 2018

Here we are demonstrating use of PasswordChar property of TextBox.

Using TextBox.PasswordChar property we can set any special character for display in the TextBox, It is basically used for password input in Windows application development.

Example:

TextBox.PasswordChar Property 1

In this example, we took a Windows form that contains a TextBox named txtInput, Here, we are setting PasswordChar property to asterisk sign (*) to input password character. In the above image – we actually input "ABCD", but instead of "ABCD" it displayed "****".

TextBox.PasswordChar Property 2

Change the property using code:

private void Form1_Load(object sender, EventArgs e)
{
	textInput.PasswordChar = '*';
}




Comments and Discussions




Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© https://www.includehelp.com some rights reserved.