When you activate an application, a textbox with text \"hello\" will appear.
My question is:
When you click on the textbox in order to make input data, I want to rem
Handle the UIElement.GotFocus event, and in the handler, clear the text. You'll also want to remove the handler, so that if you click on the TextBox a second time you don't lose what you've already entered.
Something like this:
XAML:
Code-behind:
public void TextBox_GotFocus(object sender, RoutedEventArgs e)
{
TextBox tb = (TextBox)sender;
tb.Text = string.Empty;
tb.GotFocus -= TextBox_GotFocus;
}