I have two small problems/questions about app development in Windows Phone 7.
1:
I am trying to use a generic password field in Windows Phone 7. When I created a generic regular text field, I could “pole” it’s value with the variable username.Text, (“username” being the name of the text input field).
MessageBox.Show("Success! Username: "+username.Text+", Password: "+password.Text+".");
However, when I try to do the same thing for a password box, it tells me:
Error 1 ‘System.Windows.Controls.PasswordBox’ does not contain a definition for ‘Text’ and no extension method ‘Text’ accepting a first argument of type ‘System.Windows.Controls.PasswordBox’ could be found (are you missing a using directive or an assembly reference?) C:\Users\Josha\workspace\App\App\MainPage.xaml.cs 36 93 App
I have tried searching around on the internet for hours, but have not gotten any relevant results.
Question number 2:
Does anyone know of a way to put “hint” text in said password box? I would like it to say in grayed-out letters “Password” when it is blank.
Thanks all!
for question 1:
pwdName.Passwordgive the value of the password (pwdName is the x:name of the control)For question 2: watermarking for password box is possible by creating your custom control or go through this article