cursor in the textbox not at the end of sentence

mrussell014

Member
Licensed User
Longtime User
My delema is typing and using buttons to fill a text box to make a sentence. If I type The into the text box then click the key for the word End the cursor goes to the begining of the box. So if I type Of line it will be in the textbox as Of line The End.
I have been working on this problem for 60 hours or more reading posts that don't address this problem. And trying what looked like it might. I might not know a key word that would give me a post of someone who has dealt with this before. This is the only thing keeping me from finishing. So any help is appreciated.

Thanks for reading,
Mike
 

gregmartin64

Member
Licensed User
Longtime User
My delema is typing and using buttons to fill a text box to make a sentence. If I type The into the text box then click the key for the word End the cursor goes to the begining of the box. So if I type Of line it will be in the textbox as Of line The End.
I have been working on this problem for 60 hours or more reading posts that don't address this problem. And trying what looked like it might. I might not know a key word that would give me a post of someone who has dealt with this before. This is the only thing keeping me from finishing. So any help is appreciated.

Thanks for reading,
Mike

Not sure I fully understand what your doing here, but if I'm right then it can be one of two ways I suppose.

Firstly, get the text from the edittext field and then concatenate the text and then put it back into the edittext field overwriting everthing with the newly formulated string


OR

B4X:
Something as follows, which will put the cursor at the end of the text when the control is given focus :

Sub EditText_FocusChanged (HasFocus As Boolean)
   If HasFocus Then
      EditText.SelectionStart=EditText.Text.Length
   End If
End Sub
 
Upvote 0
Top