WPF如何使用TextBox作为PasswordBox [英] WPF How to use TextBox as PasswordBox

查看:523
本文介绍了WPF如何使用TextBox作为PasswordBox的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hi Friends

我想在WPF中使用文本框作为密码框控件.我们分别有密码框控件,但我需要在同一文本框控件中使用它.但是我需要使用text属性.意味着TextBox.TextProperty.请帮帮我.

谢谢与问候
Monish K.M

Hi Friends

i want to use text box as password box control in WPF. we have password box control separately but i need it in same text box control itself.But i need to use text property.Means TextBox.TextProperty. please help me out.

Thanks & Regards
Monish K.M

推荐答案


试试这个:
要在PasswordBox中获取或设置密码,请使用Password属性.如
Hi,
Try this:
To get or set the Password in a PasswordBox, use the Password property. Such as
string password = PasswordBox.Password;



[



Or this[^].


--Amit


WPF为PaswordBox使用该控件提供了单独的密码控制

请参阅此控件的文档

http://msdn.microsoft.com/en-us/library/system. windows.controls.passwordbox.aspx [ ^ ]
WPF gives separate control for password as PaswordBox use that control

See documentation of this control

http://msdn.microsoft.com/en-us/library/system.windows.controls.passwordbox.aspx[^]


这篇关于WPF如何使用TextBox作为PasswordBox的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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