BeneBarros Active Member Licensed User Longtime User Mar 9, 2014 #1 have a strange problem I have 3 TextField where t1, t2 AND t3. Initially t2 Is disabled. 't1 typing In "00000" enables AND setfocus In t2 'Results focus on t2 AND t3 dual focus Sub Process_Globals Private fx As JFX Private MainForm As Form Private t1 As TextField Private t2 As TextField Private t3 As TextField Private FSize As Int Private Ct As Int End Sub Sub AppStart (Form1 As Form, Args() As String) MainForm = Form1 MainForm.RootPane.LoadLayout("t") 'Load the layout file. MainForm.Show t2.Enabled=False End Sub Sub t3_FocusChanged (HasFocus As Boolean) If HasFocus Then Log("t3 in") Else Log("t3 out") End If End Sub Sub t2_FocusChanged (HasFocus As Boolean) If HasFocus Then Log("t2 in") Else Log("t2 out") End If End Sub Sub t1_FocusChanged (HasFocus As Boolean) If HasFocus Then FSize=5 Else ckField End If End Sub Private Sub ckField If t1.Text = "00000" Then t2.Enabled=True t2.RequestFocus Else 'blablabla End If End Sub Attachments test.jpg 47.1 KB · Views: 545 test.zip test.zip 1.1 KB · Views: 462
have a strange problem I have 3 TextField where t1, t2 AND t3. Initially t2 Is disabled. 't1 typing In "00000" enables AND setfocus In t2 'Results focus on t2 AND t3 dual focus Sub Process_Globals Private fx As JFX Private MainForm As Form Private t1 As TextField Private t2 As TextField Private t3 As TextField Private FSize As Int Private Ct As Int End Sub Sub AppStart (Form1 As Form, Args() As String) MainForm = Form1 MainForm.RootPane.LoadLayout("t") 'Load the layout file. MainForm.Show t2.Enabled=False End Sub Sub t3_FocusChanged (HasFocus As Boolean) If HasFocus Then Log("t3 in") Else Log("t3 out") End If End Sub Sub t2_FocusChanged (HasFocus As Boolean) If HasFocus Then Log("t2 in") Else Log("t2 out") End If End Sub Sub t1_FocusChanged (HasFocus As Boolean) If HasFocus Then FSize=5 Else ckField End If End Sub Private Sub ckField If t1.Text = "00000" Then t2.Enabled=True t2.RequestFocus Else 'blablabla End If End Sub
Erel B4X founder Staff member Licensed User Longtime User Mar 10, 2014 #2 Please use [ code ] [ /code ] tags (without spaces) when posting code. Seems like a bug in JavaFX. Use CallSubDelayed: Code: Copy Sub t1_FocusChanged (HasFocus As Boolean) If HasFocus Then FSize=5 Else CallSubDelayed(Me, "ckField") End If End Sub Upvote 0
Please use [ code ] [ /code ] tags (without spaces) when posting code. Seems like a bug in JavaFX. Use CallSubDelayed: Code: Copy Sub t1_FocusChanged (HasFocus As Boolean) If HasFocus Then FSize=5 Else CallSubDelayed(Me, "ckField") End If End Sub
BeneBarros Active Member Licensed User Longtime User Mar 12, 2014 #3 thanks and congratulations for the great job you've been doing (electronically translation) Upvote 0