如何在文本框中将数据显示为(星号)**** [英] how to show data in textbox as (asterisk) ****

查看:1162
本文介绍了如何在文本框中将数据显示为(星号)****的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Windows窗体中创建密码字段,并且正在创建登录窗体,因此我需要一个可能是文本框的密码字段.但我不希望用户将文本清楚地显示为星号.我听说过屏蔽的文本框,但是我不知道如何实现它.由于它包含受限制的数据.方法.整数或字符.我希望我的文本框在按数字或按字母时显示星号*.我该如何实现呢?
在此先感谢
编程学习的新手.net

i am making a pasword field in my windows form and i am making a login form so i neend a password field which may be textbox. But i dont want user to show the text plainly i want it as asterisk. I heard about masked textbox but i dont know how to implement it. As it contains restricted data. Means. Int or char. I want my textbox to show asterisk * when a number is pressed or alphabet is pressed. How can i achive this.
Thanks in advance
am new to programming learning.net

推荐答案

将文本框的PasswordChar值设置为*

密码字段应为C#星型 [ ^ ]
Set the PasswordChar value of your text box to be *

Password field should in the star form in C#[^]


右键单击文本框,然后单击属性.在这种情况下,您将UseSystemPassword选项更改为true.它将更改为星号....
Right Click the textbox and click properties. In that u will be having UseSystemPassword option change into true.It will change into asterisk....


Freind,请使用"PasswordChar"属性并分配值"*"

谢谢,
Ambesha
Freind, Please use "PasswordChar" property and assign the value "*"

Thanks,
Ambesha


这篇关于如何在文本框中将数据显示为(星号)****的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆