Can't switch focus in IDE

Discussion in 'Bug Reports' started by N1c0_ds, May 1, 2009.

  1. N1c0_ds

    N1c0_ds Active Member Licensed User

    There is a big problem with the IDE: Control.focus will not work with invisible controls while it does at compile. Will this be fixed soon?
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Can you upload a small example?
     
  3. N1c0_ds

    N1c0_ds Active Member Licensed User

    Code:
    Sub App_Start
    TxtHidden.Visible=
    False
    TxtHidden.Focus
    'Focus doesn't change
    End Sub

    Sub Somethinghappens
    TxtHidden.Focus
    'Focus doesn't change
    End Sub

    Sub Txt_GotFocus
    'Do something
    End Sub
    In my case, I use a dummy textbox to keep the focus off the main search box when it's not in use. When the search box is focused, the text color changes from gray to black, the "Type something here" is erased and the current controls make place to search options. However since I can't set focus to another box while testing, this breaks the whole thing as the search box always regains focus, returning to search options instead of showing the search results.

    My temporary fix is the following:
    Code:
    If CPPC=True Then TxtHidden.Visible=False
    This way I can test without problems.
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    You can also hide TxtHidden by locating it behind another control.
     
  5. N1c0_ds

    N1c0_ds Active Member Licensed User

    I just set it's dimensions to 1x1, since it's hidden in the final version anyway.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice