Monday, July 27, 2009

Visual Basic 6 .NET?

When a user checks a checkbox it masks a text box so they can't see what they are typing, but I also want in to be able to be take off. How do I do this? This is what I have thus far:





If maskCheckBox.Checked = True Then


passTextBox.PasswordChar = "*"c


Else





End If

Visual Basic 6 .NET?
What you have is fine


passTextBox.PasswordChar = "*"


The "null" reference is called "nothing"


So...





If maskCheckBox.Checked = True Then


passTextBox.PasswordChar = "*"


Else


passTextBox.PasswordChar = Nothing


End If
Reply:Hi there.





There's one way that works:





passTextBox.PasswordChar = ""





This will reset the text box's password feature off.





Note: I edited it this as null instead of "" gave an error





Updated: This works for Visual Basic 6 .. but don't have .net to try it tho. You can look at this link too:





http://msdn2.microsoft.com/en-us/library...





but doesn't say much about resetting that option.





Hope this helps


No comments:

Post a Comment