How can I put some text into a TextBox which is removed automatically when user types something in it?
Set up the text box with placeholder text in a soft color...
public MainWindow ( )
{
InitializeComponent ( );
txtInput.Text = "Type something here...";
txtInput.Foreground = Brushes.DimGray;
}
When the text box gets the focus, clear it and change the text color
private void txtInput_GotFocus ( object sender, EventArgs e )
{
MessageBox.Show ( "got focus" );
txtInput.Text = "";
txtInput.Foreground = Brushes.Red;
}