-1

I need to get the following to work:

private void KeyDown(object sender,KeyEventArgs e){
    textbox1.Enabled=false;
    numericUpDown1.Enabled=true;
    numericUpDown1.Select();
}

The current problem is, that the NumericUpDown is getting enabled, but not selected. (A textbox' KeyDown event is executing the above code)

pytomaniaq
  • 114
  • 1
  • 10
  • It is not clear what you are actually trying to do. But the two marked duplicates address the most common meanings for "select", i.e. either to select the text in the control or to select the control itself. If neither of those address your question, you need to improve the question: include a good [mcve], explain precisely what user input you care about, what the code does now given that input, what you want instead, what you've tried so far, and what you are having trouble with. Be _specific_ about each of those. – Peter Duniho Jul 21 '19 at 05:12

1 Answers1

1

Just set:

numericUpDown1.Focus();

This works for each control you want to get focus.

Saeid Amini
  • 1,313
  • 5
  • 16
  • 26