1

Hello guyz can i ask for the right syntax for Focus this is what i want to be happen. if i hit the Tab(keyboard) the focus from userNameTextBox.Text will go to passwordTextBox.Textand will highlight all the characters(if there is) so that i can change it all without using Backspace(Keyboard) i already know the TabIndex property. what i'm trying to ask is what is the syntax for Highlight all characters :) your help is very appreciated :) thankyou!!

enter image description here

Yukimoto Otomikuy
  • 101
  • 2
  • 3
  • 8

1 Answers1

0

Subscribe for the Focused-Event of the Textbox. In the eventhandler you can select all text of the TextBox by doint:

private void OnFocused(object sender, EventArgs e)
{
   (sender as TextBox).SelectAll();
}
Tomtom
  • 9,087
  • 7
  • 52
  • 95