According to http://www.devexpress.com/Products/NET/Controls/WinForms/Editors/editors/textEdit.xml one can use the Developer Express TextEdit control to input a password and hide the characters. Can anyone explain to me how to do this? It seems like it should be really simple.
-
Use TextEdit.Properties.PasswordChar = '*' – Stephen Oberauer May 10 '12 at 12:56
Use RepositoryItemTextEdit.PasswordChar Property
The TextEdit has a
Properties.PasswordChar
property, which is empty by default. By >setting some char there (for example, *), you will enable the functionality you require.
Password mode allows you to mask the editor's text. You can activate password mode in two ways:
Set the
UseSystemPasswordChar
property totrue
. The editor's text will be masked as follows:Set the
PasswordChar
property toany valid character
. This character will be used to mask the editor's text.For instance, if the
PasswordChar
property is set to"*"
, an editor will work as you want to do.
Note: The PasswordChar
property is ignored if the RepositoryItemMemoEdit.UseSystemPasswordChar
property is set to true
.
Pragmatically you can set it as:
TextEdit.Properties.PasswordChar = '*'
And From GUI go to Properties section and then further look for the Properties
there you will get the PasswordChar
property, Set it to valid character as per documentation. e.g. *
.
Set PasswordChar
property of TextBox
to the character which should be visible in the text box instead of the real text.
For example:
textBox.PasswordChar = '*';
-
I don't have a PasswordChar. Maybe because I'm using an old version of DevExpress (8.2). Perhaps it's something that was added later. I'll have to investigate. – Stephen Oberauer May 10 '12 at 12:23
-
Oh, I missunderstood your question. I thought you were talking about Visual Studio Express and I was talking about the regular .NET TextBox. – Marek Dzikiewicz May 10 '12 at 12:41
You can achieve the same with the regular TextBox control if you set the TextBox.UseSystemPasswordChar to true. This setting will also cause the TextBox control to display a tooltip warning if your CapsLock is on, just like in the Windows Login screen.
-
Thanks, but I don't want to use a regular TextBox. I want to use a DevExpress control. – Stephen Oberauer May 10 '12 at 12:32