L Laurie Member Licensed User Longtime User Mar 20, 2014 #1 Is it possible to automatically copy text entered into one EditText field into a second EditText field?
Is it possible to automatically copy text entered into one EditText field into a second EditText field?
M Mahares Expert Licensed User Longtime User Mar 20, 2014 #2 Are you looking for something like this or am I too simplistic. Code: Copy Sub txtTest2_EnterPressed txtTest.Text=txtTest2.Text 'txttest mimics txttest2 End Sub Upvote 0
Are you looking for something like this or am I too simplistic. Code: Copy Sub txtTest2_EnterPressed txtTest.Text=txtTest2.Text 'txttest mimics txttest2 End Sub
L Laurie Member Licensed User Longtime User Mar 20, 2014 #3 Thanks Mahares, but my problem is that I am using a group of EditText inputs - ie EdTxt.Text which are usually identified by edt = Sender They do each have their own tag ie EdTxt.Tag = 1 to 36 for example. But I don't know how to address a particular EdTxt. Setting EdTxt.Tag = the EditText I want to write to and then EdTxt.Text="New Value" doesn't work Upvote 0
Thanks Mahares, but my problem is that I am using a group of EditText inputs - ie EdTxt.Text which are usually identified by edt = Sender They do each have their own tag ie EdTxt.Tag = 1 to 36 for example. But I don't know how to address a particular EdTxt. Setting EdTxt.Tag = the EditText I want to write to and then EdTxt.Text="New Value" doesn't work
Erel B4X founder Staff member Licensed User Longtime User Mar 20, 2014 #4 Add all of them to a List or Map (or array) and then you will be able to access them easily. Upvote 0
L Laurie Member Licensed User Longtime User Mar 20, 2014 #5 Would I have been better creating an array in the first place? Upvote 0
klaus Expert Licensed User Longtime User Mar 20, 2014 #6 If the EditText views are on a Panel with no other view on it you can get them easily with Panel.GetView(Index). The Index order is the order the EditTexts were added to the panel. Upvote 0
If the EditText views are on a Panel with no other view on it you can get them easily with Panel.GetView(Index). The Index order is the order the EditTexts were added to the panel.
L Laurie Member Licensed User Longtime User Mar 21, 2014 #7 My EditText views are all a panel but I'm afraid I still don't understand how to achieve my objective. Let's assume I have a number, say "99" that I want to enter into a specific EditText box programmatically. What should the code be? Upvote 0
My EditText views are all a panel but I'm afraid I still don't understand how to achieve my objective. Let's assume I have a number, say "99" that I want to enter into a specific EditText box programmatically. What should the code be?
klaus Expert Licensed User Longtime User Mar 21, 2014 #8 In the Panel your EditText views have an index. If you add EditText1, EditText2, EditText3 ... and so on. EditText1 has index 0, EditText2 has index 1, EditText3 has index 2, ... and so on So if you want to set the text "99" to EditText45: Code: Copy Dim edt As EditText edt = Panel1.GetView(44) edt.Text = "99" Last edited: Mar 21, 2014 Upvote 0
In the Panel your EditText views have an index. If you add EditText1, EditText2, EditText3 ... and so on. EditText1 has index 0, EditText2 has index 1, EditText3 has index 2, ... and so on So if you want to set the text "99" to EditText45: Code: Copy Dim edt As EditText edt = Panel1.GetView(44) edt.Text = "99"
L Laurie Member Licensed User Longtime User Mar 22, 2014 #9 Thanks Klaus, that works brilliantly. Really appreciate everyone's input and the speed of response to appeals for help! Upvote 0
Thanks Klaus, that works brilliantly. Really appreciate everyone's input and the speed of response to appeals for help!