I have searched and searched, with no luck.
I have a Form that has several event listeners in it (Keypresses, speech
recognition, afew others). When I click a component in the form (such as a
button), the form itself loses focus.
How can I get it back? I have tried this.Focus() from w/in the form in a
timer with no luck as well as several other things.
Thanks!
Morten Wennevik [C# MVP] - 28 Apr 2008 06:13 GMT
Hi Jesse,
I'm guessing you have some code that is causing the form to lose focus.
This code may well also preventing you from resetting it. Review your code
to see if there is any code that may do so, possibly with assistance of the
LostFocus event to determine when this happens.

Signature
Happy Coding!
Morten Wennevik [C# MVP]
> I have searched and searched, with no luck.
>
[quoted text clipped - 6 lines]
>
> Thanks!
Tantr Mantr - 28 Apr 2008 09:26 GMT
Do you have anything in the Form Activate event? Try disabling all the form
events.
Cheers!
> I have searched and searched, with no luck.
>
[quoted text clipped - 6 lines]
>
> Thanks!
Ben Voigt [C++ MVP] - 29 Apr 2008 19:08 GMT
> I have searched and searched, with no luck.
>
[quoted text clipped - 4 lines]
> How can I get it back? I have tried this.Focus() from w/in the form
> in a timer with no luck as well as several other things.
Instead of trying to make the Form regain focus, make the event handlers
work no matter what has focus.
Try this:
http://msdn2.microsoft.com/en-us/library/system.windows.forms.application.addmes
sagefilter.aspx
> Thanks!