Avon Member Licensed User Longtime User Sep 12, 2011 #1 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?
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?
K kickaha Well-Known Member Licensed User Longtime User Sep 12, 2011 #2 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
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.
Avon Member Licensed User Longtime User Sep 12, 2011 #3 Diolch kickaha. This must be one of the few things which is actually easier in Java! Upvote 0