Can't switch focus in IDE

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?
 

N1c0_ds

Active Member
Licensed User
B4X:
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:
B4X:
If CPPC=True Then TxtHidden.Visible=False

This way I can test without problems.
 
Top