E EdQas Member Licensed User Sep 9, 2007 #1 My program is like that : Sub App_Start ... AddEvent("Lc",Click,"MySub") -> Lc is a textbox ... End Sub Sub MySub MyKey=sender Select MyKey Case "Lc" ... End Select End Sub When i run the program and i click in my textbox, the program doesn't go to "MySub" Anybody can help me ? Thank you ! EdQas Last edited: Sep 9, 2007
My program is like that : Sub App_Start ... AddEvent("Lc",Click,"MySub") -> Lc is a textbox ... End Sub Sub MySub MyKey=sender Select MyKey Case "Lc" ... End Select End Sub When i run the program and i click in my textbox, the program doesn't go to "MySub" Anybody can help me ? Thank you ! EdQas
Erel B4X founder Staff member Licensed User Longtime User Sep 9, 2007 #2 You can only use events that are supported by the control. Try changing it to: AddEvent("Lc",GotFocus,"MySub")
You can only use events that are supported by the control. Try changing it to: AddEvent("Lc",GotFocus,"MySub")
E EdQas Member Licensed User Sep 9, 2007 #3 AddEvent Hello Erel, I already tried to use with "GotFocus" and it's the same thing; impossible to the program to enter in "MySub".
AddEvent Hello Erel, I already tried to use with "GotFocus" and it's the same thing; impossible to the program to enter in "MySub".
Erel B4X founder Staff member Licensed User Longtime User Sep 9, 2007 #4 Try the attached code. Attachments a.sbp 593 bytes · Views: 167
E EdQas Member Licensed User Sep 9, 2007 #5 AddEvent In fact, Erel, i put a "break" just after Sub MySub. The program enters in "MySub" but having nothing to "break", the program goes on correctly. Beginning is difficult, i'm loosing my hair !!! [look to my avatar] :sign0144: Thank you very much Erel ! EdQas
AddEvent In fact, Erel, i put a "break" just after Sub MySub. The program enters in "MySub" but having nothing to "break", the program goes on correctly. Beginning is difficult, i'm loosing my hair !!! [look to my avatar] :sign0144: Thank you very much Erel ! EdQas
D dennishea Active Member Licensed User Sep 9, 2007 #7 I not sure if this satisfys what your trying to do but it works. Sub Globals 'Declare the global variables here. MyKey = "Lc" End Sub Sub App_Start MySub form1.Show End Sub Sub MySub Select MyKey Case "Lc" Label1.Text = "Hi" label1.Visible = true End Select End Sub dennishea
I not sure if this satisfys what your trying to do but it works. Sub Globals 'Declare the global variables here. MyKey = "Lc" End Sub Sub App_Start MySub form1.Show End Sub Sub MySub Select MyKey Case "Lc" Label1.Text = "Hi" label1.Visible = true End Select End Sub dennishea