Android Question Multiple edittext one made up soft keyboard

Yves Mazzon

Member
Licensed User
Longtime User
All,
Bear with me I just learning the B4a language. I copied the soft keyboard provided on the beginner guide called "my second program".
Where I'm stock is how do I connect my soft keyboard on each editText so I can enter a numerical value when they pressed?
Perhaps I must write the routine in each sub?????????
 
Let me rephrase my question above.
I have 8 EditText what would be the routine that indicate which EditText has been touched so I can enter values with my keyboard?
 
Upvote 0
Do you really need EditText views ?
SecondProgram in the Beginner's Guide uses a Label instead of an EditText to avoid that the user interfers in the EditText view.
There are different possibilties, below a simple example.
You could add a Global variable holding the selected Lablel for example:
Dim lblSelected As Label
Add a Click event for all Labels, in this event set the global variable to the calling Label.
Sub lbl_Click
lblSelected = Sender
End Sub

In the btnEvent_Click routine replace lblResult by lblSelected.
 
Upvote 0
Thanks Klaus,
I'm going to try your suggestion. Can you please let me know what Sender is and do? It is so difficult to find an indexed manual that explain every functions and properties with B4A. There is no proper manual. Does it?
Regards,

Yves
 
Upvote 0
Upvote 0
Do you really need EditText views ?
SecondProgram in the Beginner's Guide uses a Label instead of an EditText to avoid that the user interfers in the EditText view.
There are different possibilties, below a simple example.
You could add a Global variable holding the selected Lablel for example:
Dim lblSelected As Label
Add a Click event for all Labels, in this event set the global variable to the calling Label.
Sub lbl_Click
lblSelected = Sender
End Sub

In the btnEvent_Click routine replace lblResult by lblSelected.

Thank you Klaus,
I'm still battling to understand the nitty gritty and not sure to understand the logic of it. I have attached what I wrote so far. Can you please give me a "push start" and I'm sure I will be able to fly with my own wings and stop bothering the forum with problems that may look silly to other.
 

Attachments

Upvote 0
you did create a sub
Code:
Sub lbl_Click
    lblSelected = Sender
End Sub
but the labels you defined in designer does not have the eventname "lbl"... they had lbldata1 and lbldata2... I changed oth to lbl

THEN in your
Code:
Sub btnEvent_Click
End Sub
sub you used always lablSelected instead of lblSelected
 

Attachments

Upvote 0
Attached a modified version.
You ust be consistent in the variable namees !!!!
Examples:
lablSelected and lblSelected
labelData2 and lblData2
I changed the colors of the labels to show which label is selected.
 

Attachments

Upvote 0
you did create a sub
Code:
Sub lbl_Click
    lblSelected = Sender
End Sub
but the labels you defined in designer does not have the eventname "lbl"... they had lbldata1 and lbldata2... I changed oth to lbl

THEN in your
Code:
Sub btnEvent_Click
End Sub
sub you used always lablSelected instead of lblSelected

Thank you very much Don,
No I learn where the event must be mentioned so now I can go on. You saved my day.

Yves
 
Upvote 0
Back
Top