Form Lost Focus

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?SmVzc2U=?=

    Form Lost Focus

    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!
  • =?Utf-8?B?TW9ydGVuIFdlbm5ldmlrIFtDIyBNVlBd?=

    #2
    RE: Form Lost Focus

    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.

    --
    Happy Coding!
    Morten Wennevik [C# MVP]


    "Jesse" wrote:
    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!

    Comment

    • =?Utf-8?B?VGFudHIgTWFudHI=?=

      #3
      RE: Form Lost Focus

      Do you have anything in the Form Activate event? Try disabling all the form
      events.

      Cheers!

      "Jesse" wrote:
      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!

      Comment

      • Ben Voigt [C++ MVP]

        #4
        Re: Form Lost Focus

        Jesse wrote:
        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.
        Instead of trying to make the Form regain focus, make the event handlers
        work no matter what has focus.

        Try this:

        >
        Thanks!

        Comment

        Working...