CN_guy
New Member
I'm a beginner.
I want to make an Android APP like CMD , but I have some questions .
I made a editText , I hope when I press Enter , I can't change the words before , so I think I can get EditText.SelectionStart , if it isn't in the end , the editText will not be change.
But this APP does not work properly ,I don't know why , could you teach me ?
I want like this
My english is not very well , thanks for your reading and help
I want to make an Android APP like CMD , but I have some questions .
I made a editText , I hope when I press Enter , I can't change the words before , so I think I can get EditText.SelectionStart , if it isn't in the end , the editText will not be change.
But this APP does not work properly ,I don't know why , could you teach me ?
B4X:
Sub Globals
Private EditText1 As EditText
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("main")
EditText1.Height=100%y
EditText1.Width=100%x
EditText1.Left=Activity.Left
EditText1.Top=Activity.Top
EditText1.Color=Colors.Black
EditText1.TextSize=13
EditText1.Text="mini-CMD [v 1.1.1001]"& CRLF & "2018-1-10 N"
End Sub
Sub EditText1_TextChanged (Old As String, New As String)
Dim gb As Int = EditText1.SelectionStart
If gb<EditText1.Text.Length Then
EditText1.Text =Old
End If
End Sub
I want like this

My english is not very well , thanks for your reading and help
Last edited: