B4J Question comboBox Action event

Erel

Administrator
Staff member
Licensed User
The two events are:

B4J_62Sbw0Wyr2.png
 
Upvote 0
Thank you for your answer, but maybe I asked the wrong ... I want when I'm in the combo box and press the enter key to go to the next control - something like that

B4X:
Sub txtUser_Action
    txtIme.RequestFocus
    txtIme.SelectAll
End Sub
 
Upvote 0
You can use any obj.Requestfocus in one of the available Events. There is not Action Event.
thanks for the reply - I understood that there is not Action Event for combobox ... that's why I'm looking for help on how to handle " press the enter key event" to hand over control to the next object
 
Upvote 0
and I succeeded thanks to Erel

B4X:
Sub RootPaneKeyEvent_Event(e As Event)
    Dim KE As Reflector
    KE.Target = e     ' e is a KeyEvent instance
    Dim KeyCode As String
    KeyCode = KE.RunMethod("getCode")
    
    If KeyCode = "ENTER" And mComboBox1=True Then
        Log("Pressed ENTER in ComboBox1")
        TextField2.RequestFocus
    End If
    
    If KeyCode = "ENTER" And mComboBox2=True Then
        Log("Pressed ENTER in ComboBox2")
        TextField1.RequestFocus
    End If
End Sub
 

Attachments

  • 3-1-1.zip
    2.6 KB · Views: 74
Upvote 0
Top