Application.DoEvents();
Wieso wird der Focus nicht sofort auf meine TextBox gesetzt?
Da ich gerade einen andere EventHandler ausführe, warten die anderen noch...
Mit Application.DoEvents() werden die anderen Events abgehandelt.
// Focus auf 1. TextBox setzen
textBox24.Focus();
Application.DoEvents();
...
aus MSDN:
Each time the form handles an event, it processes all the code associated with that event. All other events wait in the queue.
No comments:
Post a Comment