B4J Question Reset TextField to previous text?

markm

Member
Licensed User
Longtime User
I have a form with several textfields on it. I want to capture Escape so that if it's pressed, the textfield is reset to its previous text. For example, if textfield.text = "Hi, Bob!" and the user starts typing "Hello, Bill" in it but changes his mind and hits ESC, it will reset to "Hi, Bob!". I have done this on forms with a single textfield by setting a reflector to monitor the textfield and then matching the event type. However, setting a reflector and a filtering sub for each textfield seems excessive. Is there a simple way I'm overlooking for a textfield to be reset in the _TextChanged Sub to say "if last key = Escape, Textfield.text = Old"?
 

EnriqueGonzalez

Well-Known Member
Licensed User
Longtime User
there is a state manager for B4A

it seems too attached to that platform so, if Erel would not create one for B4J then you should check the code module and fit it for b4j.
 
Upvote 0
Top