Akacoo New Member Feb 10, 2020 #1 TextBox (EditText) can be selected with TextBox1.Select() in VS. I can't do the same on B4A. Example: EditText1.Select()
TextBox (EditText) can be selected with TextBox1.Select() in VS. I can't do the same on B4A. Example: EditText1.Select()
Mark Read Well-Known Member Licensed User Longtime User Feb 10, 2020 #3 Or to select the end of the text in the EditText, you can use the code from Klaus: B4X: Copy EditText1.Text = "Test" EditText1.RequestFocus EditText1.SelectionStart = EditText1.Text.Length Upvote 0
Or to select the end of the text in the EditText, you can use the code from Klaus: B4X: Copy EditText1.Text = "Test" EditText1.RequestFocus EditText1.SelectionStart = EditText1.Text.Length
Akacoo New Member Feb 10, 2020 #4 It was not SelectAll. I finally found it. It would be RequestFocus. The TextBox (EditText) can be selected with TextBox.Select() in .NET. Why is RequestFocus() on B4A? Code: Copy Sub CheckBox1_CheckedChange(Checked As Boolean) If CheckBox1.Checked = True Then EditText1.Enabled=True IME.ShowKeyboard(EditText1) EditText1.RequestFocus() Else EditText1.Enabled=False EditText1.Text = "" Spinner1.Visible=False End If End Sub Upvote 0
It was not SelectAll. I finally found it. It would be RequestFocus. The TextBox (EditText) can be selected with TextBox.Select() in .NET. Why is RequestFocus() on B4A? Code: Copy Sub CheckBox1_CheckedChange(Checked As Boolean) If CheckBox1.Checked = True Then EditText1.Enabled=True IME.ShowKeyboard(EditText1) EditText1.RequestFocus() Else EditText1.Enabled=False EditText1.Text = "" Spinner1.Visible=False End If End Sub
Erel B4X founder Staff member Licensed User Longtime User Feb 10, 2020 #5 Akacoo said: Why is RequestFocus() on B4A? Click to expand... Why is Select() in .Net? Upvote 0
Peter Simpson Expert Licensed User Longtime User Feb 11, 2020 #6 Firstly welcome to the community, may you have many many many hours of great app development using the full suite of B4X development tools. Now lets answer your question. Akacoo said: The TextBox (EditText) can be selected with TextBox.Select() in .NET. Why is RequestFocus() on B4A? Click to expand... Because B4A is not a M$ product like VS Upvote 0
Firstly welcome to the community, may you have many many many hours of great app development using the full suite of B4X development tools. Now lets answer your question. Akacoo said: The TextBox (EditText) can be selected with TextBox.Select() in .NET. Why is RequestFocus() on B4A? Click to expand... Because B4A is not a M$ product like VS
aeric Expert Licensed User Longtime User Feb 11, 2020 #7 B4A: Textbox1.RequestFocus VB.NET: Textbox1.Focus() IMO, RequestFocus in B4A is more powerful as it returns True if the focus was set. Upvote 0
B4A: Textbox1.RequestFocus VB.NET: Textbox1.Focus() IMO, RequestFocus in B4A is more powerful as it returns True if the focus was set.