PDA

View Full Version : TextField Keep Focus Unless Validated or Empty



rhb327
9th May 2020, 19:27
Suppose you have a TextField delegate. And you assigned validators to the appropriate indexes as needed. What's the correct way to validate the data before allowing focus to move to the next test field (or return to that same field until validated upon check)?

I've tried various combinations of FocusChanged EditingFinished, etc. but in general I have not found a way to stay in the field unless validated.

Also, it seems you could lose focus via mouse or on screen keyboard so preferably both cases would need to be handled.

Any simple examples someone has would be welcome!

Thanks,
-Rich