TextBox.PasswordChar set to true?

  • Thread starter Thread starter rosty
  • Start date Start date
R

rosty

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 set to true, cut, copy, and paste actions
in the control using the keyboard are not allowed, regardless of whether the
Multiline property is set to true or false."

Is it a typo in MSDN or something? How can i set PasswordChar to true since
it is a char? And it gives of course a build error. " Cannot implicitly
convert type 'bool' to 'char' "

Any suggestions?
 
Rosty,

I would say this is a typo from Microsofts part. What it should say
is when this property is not empty, then the provided characters will
be used to mask the input. So basicly the character you set this
property to will be displayed instead of the typed characters. The
standard character to use is the star *

myTextBox.PasswordChar = '*':

Note that when using a single character you use the single quotation '
mark and not the double quotation mark.

HTH,

//Andreas

--
ANDREAS HÅKANSSON
STUDENT OF SOFTWARE ENGINEERING
andreas (at) selfinflicted.org
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 set to true, cut, copy, and paste actions
in the control using the keyboard are not allowed, regardless of whether the
Multiline property is set to true or false."

Is it a typo in MSDN or something? How can i set PasswordChar to true since
it is a char? And it gives of course a build error. " Cannot implicitly
convert type 'bool' to 'char' "

Any suggestions?
 
yes, i see, just have been told by a fellow that MSDN is full of typos, don't know if it's true but looks like here it is at least one of them
"Andreas Håkansson" <andreas (at) selfinflicted.org> wrote in message Rosty,

I would say this is a typo from Microsofts part. What it should say
is when this property is not empty, then the provided characters will
be used to mask the input. So basicly the character you set this
property to will be displayed instead of the typed characters. The
standard character to use is the star *

myTextBox.PasswordChar = '*':

Note that when using a single character you use the single quotation '
mark and not the double quotation mark.

HTH,

//Andreas

--
ANDREAS HÅKANSSON
STUDENT OF SOFTWARE ENGINEERING
andreas (at) selfinflicted.org
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 set to true, cut, copy, and paste actions
in the control using the keyboard are not allowed, regardless of whether the
Multiline property is set to true or false."

Is it a typo in MSDN or something? How can i set PasswordChar to true since
it is a char? And it gives of course a build error. " Cannot implicitly
convert type 'bool' to 'char' "

Any suggestions?
 
rosty said:
yes, i see, just have been told by a fellow that MSDN is full of
typos, don't know if it's true but looks like here it is at least one
of them

There are certainly several mistakes in there, and bits of dodgy code.
I've made a point of using the link at the bottom of the page to tell
MS whenever I see a problem - they're very good at acknowledging
mistakes and fixing them for the next MSDN release.
 
Back
Top