how to eat return key

Avon

Member
Licensed User
Longtime User
I can catch the return key in an edit box, how do I consume it so that it doesn't send a CR to the edit box please?
 
You can use the EditText.TextChanged event. This is called every time the text in the EditText box is changed so all you need to do is check for a CR in the new string, and if there is one revert back to the old string:

Code: Copy
MyEditBox.TextChanged (Old As String, New As String)
If New.Contains (CRLF) Then MyEditBox.Text = Old
Return

You will need to check the syntax for using CRLF, as I am not sure this is correct.
 
Upvote 0
Back
Top