"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:O6*************@TK2MSFTNGP11.phx.gbl...
* "Gilbert Tordeur" <gi*************@fr.york.com> scripsit: How can I set the focus on a specified control in a Windows form ?
In addition to the other replies: Notice that the focus can only be set
to a visible and enabled control.
Ugh! This is SO important. I wasted a whole day not being able to figure out
why button1.PerformClick() wasn't working. Turns out it will only work IF
the button is enabled. BTW, is there a way to execute the sub if the button
IS NOT enabled? It's no big deal to check it's status, enable it if off, and
disable it again later (well, it is kind of a pain) but it would be nice to
be able to override it without worrying about it's status and making sure
it's returned to it's previous state.