|How to convert characters the User enters into a Textbox to CAPs conditionally? [message #1219507]
||Wed, 04 December 2013 05:38
| Tilak Sharma
Registered: July 2009
How to convert characters the User enters into a Textbox to CAPs conditionally?|
We have a peculiar use-case where in, we have:
- 1 A Textbox (org.eclipse.swt.widgets.Text), in which user types in.
- 2 A checkbox (which reads: Convert to Uppercase)
If this checkbox is Checked, each of the character the User types in from that moment should be converted to Capital letter.
If he unchecks that and types again, we should retain the earlier text as it is and continue to accept the letters as he types in, without any case modification.
We tried using the org.eclipse.swt.events.KeyListener, but we are compelled to handle all the cases like, Backspace, Control, Delete, Tab, Num Pad key presses, etc.
We also tried VerifyListener, but that gives me the complete text and not just the recently typed in character/key.
Is there a simple way to achieve this?
[Updated on: Wed, 04 December 2013 06:42]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.01984 seconds