c#中textbox属性_C#.Net中带有示例的TextBox.PasswordChar属性

c#中textbox属性

Here we are demonstrating use of PasswordChar property of TextBox.

在这里,我们演示了TextBoxPasswordChar属性的使用。

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.

使用TextBox.PasswordChar属性,我们可以设置要在TextBox中显示的任何特殊字符,它基本上用于Windows应用程序开发中的密码输入。

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 "****".

在此示例中,我们采用了一个Windows窗体,其中包含一个名为txtInput的文本框 ,在这里,我们将PasswordChar属性设置为星号(*),以输入密码字符。 在上图中–我们实际上输入了“ ABCD” ,但显示的是“ ****”而不是“ ABCD

TextBox.PasswordChar Property 2

Change the property using code:

使用代码更改属性:

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


翻译自: https://www.includehelp.com/dot-net/textbox-passwordchar-property-with-example.aspx

c#中textbox属性

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值