473,385 Members | 1,610 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

passwordchar un/mask?

I am creating an application which is password controlled on startup. I
created a textbox for the user to enter the password. However, I would
like to also have a menu option so the user can choose to see '*' in the
password box, or the plain text that they are typing in. I want to do
this because it is for pocketpc2002 and the characters might not always
appear as you think you are writing them in, hence the user option.

The problem is that I can set myTextBox.passwordchar = '*' and that masks
it for the user fine. However, I can't get it to switch back to the plain text
version, once it is masked.

I thought that the following would reset it back to text view, but it
didn't work:

if (mask == false) {
myTextBox.passwordchar = '';
}

I also tried, among others:
myTextBox.passwordchar = null;
myTextBox.passwordchar = Convert.toChar("");

So, how can I switch it to unmasked, once it is already masked?
TIA,
-John

Nov 15 '05 #1
1 5970
try:
myTextBox.PasswordChar = char.MinValue;

In VB, it seems, it is perfectly viable to set a character to Nothing (thats
wierd...wonder how that works, I need to do some disassembly), but since
char is a valuetype, it isn't possible to be null, which is what causes this
problem.
"John" <Je***@SbcglobalDotNetwork.NoSpam> wrote in message
news:pa****************************@SbcglobalDotNe twork.NoSpam...
I am creating an application which is password controlled on startup. I
created a textbox for the user to enter the password. However, I would
like to also have a menu option so the user can choose to see '*' in the
password box, or the plain text that they are typing in. I want to do
this because it is for pocketpc2002 and the characters might not always
appear as you think you are writing them in, hence the user option.

The problem is that I can set myTextBox.passwordchar = '*' and that masks
it for the user fine. However, I can't get it to switch back to the plain text version, once it is masked.

I thought that the following would reset it back to text view, but it
didn't work:

if (mask == false) {
myTextBox.passwordchar = '';
}

I also tried, among others:
myTextBox.passwordchar = null;
myTextBox.passwordchar = Convert.toChar("");

So, how can I switch it to unmasked, once it is already masked?
TIA,
-John

Nov 15 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Rick | last post by:
In VB .Net how do I make the PasswordChar property of a Textbox work out to be that nice big round dot that we see in most system password fields? There is no special character I can see to place...
3
by: rosty | last post by:
This is taken from MSDN (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html /frlrfsystemwindowsformstextboxclasspasswordchartopic.asp) "When the PasswordChar property is...
1
by: Joe Spin | last post by:
Hi, I'm using the TextBox.PasswordChar property with a '*' to mask passwords written in the textbox. In some workstations it works fine , but there are some workstations (win2K and XP) that...
5
by: Hareth | last post by:
Is there a way to take a text, from a textbox & later passwordChar the text. I'm not using a masked textbox. I tried: textBox1.PasswordChar = '*'; but this didn't change my text. I know how...
7
by: siddhiash | last post by:
Hi Friends I want to add PasswordChar Property which shows ****** for string which I type in PropertyGrid Control. Regards, Siddharth
7
by: Ryan | last post by:
I'm creating a user control that has a handful of controls on it (19 in total). One of the controls on the UC is a textbox for a user's password, so I've set the PasswordChar property to "*". I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.