I am trying to have the contained text selected when an EditExt has focus. I have searched the forum and have found recommendations on how to do this. The problem I am having is that in the three test examples below, each will perform the SelectAll function I need in Android V2 (Froyo), but will not do so in Android V4 (ICS). I only have the two devices for testing.
I have run out of ideas as to how this might be done. If anyone has had success in doing this across the various versions of Android, I would greatly appreciate their help in resolving my dilemma.
Best regards :sign0085:
B4X:
' test example one
Sub EditOne_FocusChanged(HasFocus As Boolean)
If HasFocus = True Then
EditOne.SelectAll
End If
End Sub
' *********************************************
' test example two
Sub EditOne_FocusChanged(HasFocus As Boolean)
If HasFocus = True Then
EditOne_Click
End If
End Sub
Sub EditOne_Click 'if in focus
EditOne.SelectAll
End Sub
' *********************************************
' test example three
Sub EditOne_FocusChanged(HasFocus As Boolean)
If HasFocus = True Then
EditOne_Click
End If
End Sub
Sub EditOne_Click 'if in focus
CallSubDelayed(Me, "EditOne_SelectText")
End Sub
Sub EditOne_SelectText
EditOne.SelectAll
End Sub
Simil problem to select all text with autocompletation control
i have a autocompletation button, one command button and one gridview.
I cant' dovents in SELECTTEXT event because this event there are not supported.
The focus allways are in a autocompletation control, consequently a can't to this in the FOCUSCHANGED event.
I think to put a textbox to send focus to this control and before do selectall in focuschanged (incluying doevent), but this is not a correct programation for me.