I'm trying to imagine all possible scenarios, and the best way Gambas
can guess when you finish to enter data is the LostFocus event.
The keypress event is not the best option for your want to do.
Or probably instead to change the value on the TextBox probably you
may want to change a variable on
Probably the issue here is the event in which your code is.
When Gambas recognize the 'c' it changes .text to 1, that is why you
are getting the "1l",
What is the event you are using to perform the textbox validation?
Try to change your validation code to the LostFocus() event.
Probably will work
Where are you checking this?
Key press event.
I would wait for another key like the return key. And then check.
if key.code = key.return then
if textbox1.text="c" then
textbox1.text="1"
else
if textbox1.text="cl" then
textbox