I'm making a login screen for a wpf application. I want 2 textboxes, one for username and password.
For username, I have used a textbox and added text to it ('Username') which disappears when the user clicks on it to enter their username. I done it with the code below.
I can't seem to replicate this for password. I don't believe i'll be able to use a textbox as I wont be able to disguise the user input to *'s or whatever, and I cant figure out a way to hardcode 'password' into the box for it to disappear when the user clicks.
How can I do this? I know its possible as loads of sites have this functionality but I cant figure it out after googling for a long time!
I should stress that im completely new to programming so answers aimed at a complete novice would be much appreciated!
xaml: GotFocus="UserNameTextbox_OnGotFocus" Foreground="#FFA19DA1"/>
private void UserNameTextbox_OnGotFocus(object sender, RoutedEventArgs e)
UserNameTextbox.Text = "";
Username example here