Initially focused control

  • Thread starter Thread starter Markus Wildgruber
  • Start date Start date
M

Markus Wildgruber

Hi!

I designed a windows forms dialog with some controls on it. When it loads I
want to set the control that has the input focus when the form is displayed.
Somehow calling the Focus()-method of the control that I want to have focus
in the Form.Load-Eventhandler does not work.
Does anyone know a solution?

TIA,

Markus
 
Hello,
Markus Wildgruber said:
I designed a windows forms dialog with some controls on
it. When it loads I want to set the control that has the input
focus when the form is displayed. Somehow calling the
Focus()-method of the control that I want to have focus
in the Form.Load-Eventhandler does not work.
Does anyone know a solution?

Set the control's TabIndex property to 0. Alternatively, you can call a
"Me.Show()" in "Sub Form_Load" and set the focus _after_ showing the form.

Regards,
Herfried K. Wagner
 
Back
Top