Multiple Textboxes

wdegler

Active Member
Licensed User
Longtime User
I have multiple textboxes (EditText boxes) on the screen at once. I wish to click on one, enter data, click on the next, enter data etc and only press Enter (or Done) when finished. Only the data of the last textbox is available when I do this. I have tried using TextChanged and FocusChanged events to accomplish this but neither seems to do anything.

Changing text as I am entering it does not raise the TextChanged event and clicking on the next textbox does not raise the FocusChanged event.


1) How can I enter multiple data items with only one press of Enter(Done)?
2) Exactly what is necessary for the events above to be called?
 

ScarBelly

Member
Licensed User
Longtime User
Initialize your textboxes with one EnterPressed event like:
TextBox1.Initialize("TextBoxEnter")
TextBox2.Initialize("TextBoxEnter")

Then have one event:

Sub TextBoxEnter_EnterPressed
'Read all textboxes here

End Sub
 
Upvote 0

wdegler

Active Member
Licensed User
Longtime User
Thank you Scarbelly

Thank you very much. This is a big help. It works perfectly.
In fact, it was so obvious I should have thought of it!
 
Upvote 0

wl

Well-Known Member
Licensed User
Longtime User
Just a note: you can read "sender" to determine on which textbox the eventhandler was effetively executed. The 'tag" property can alsocomein handy in these cases...

Wim
 
Upvote 0
Top