title: WPF textbox/password box text disappear on click
body: <p>I'm making a login screen for a wpf application.  I want 2 textboxes, one for username and password.  </p>
  
  <p>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.</p>
  
  <p>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.</p>
  
  <p>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! </p>
  
  <p>I should stress that im completely new to programming so answers aimed at a complete novice would be much appreciated!</p>
  
  <p>Thanks</p>
  
  <p>xaml:  GotFocus="UserNameTextbox_OnGotFocus" Foreground="#FFA19DA1"/> </p>
  
  <pre><code>private void UserNameTextbox_OnGotFocus(object sender, RoutedEventArgs e)
      {
          UserNameTextbox.Text = "";
      }
  </code></pre>
  
  <p><a href="http://i.stack.imgur.com/qPAOT.png" rel="nofollow">Username example here</a></p>