Roger Daley Well-Known Member Licensed User Longtime User Dec 14, 2020 #1 Hi All, In B4A this works: B4X: 'Display1 created in Designer' Private Display1 as EditText Display1.SelectionStart = Display1.Text.Length When Display1 is declared as B4XView it flags "Unknown member: selectionstart" B4X: 'Display1 created in Designer' Private Display1 as B4XView Display1.SelectionStart = Display1.Text.Length It seems too simple to go wrong, but.......... Help would be much appreciated. Regards Roger Last edited: Dec 14, 2020
Hi All, In B4A this works: B4X: 'Display1 created in Designer' Private Display1 as EditText Display1.SelectionStart = Display1.Text.Length When Display1 is declared as B4XView it flags "Unknown member: selectionstart" B4X: 'Display1 created in Designer' Private Display1 as B4XView Display1.SelectionStart = Display1.Text.Length It seems too simple to go wrong, but.......... Help would be much appreciated. Regards Roger
LucaMs Expert Licensed User Longtime User Dec 14, 2020 #2 When a member does not exist (property or method) you have to use the original view. B4X: #If B4A Dim Disp1 As EditText = Display1 #Else If B4J Dim Disp1 As TextField = Display1 #Else If B4I ' I don't know, not having B4I; it should be the same of B4J #End If Disp1.SelectionStart = Disp1.Text.Length Last edited: Dec 14, 2020 Upvote 0
When a member does not exist (property or method) you have to use the original view. B4X: #If B4A Dim Disp1 As EditText = Display1 #Else If B4J Dim Disp1 As TextField = Display1 #Else If B4I ' I don't know, not having B4I; it should be the same of B4J #End If Disp1.SelectionStart = Disp1.Text.Length
LucaMs Expert Licensed User Longtime User Dec 14, 2020 #3 You are right to be surprised: I had forgotten a "l", but now I have corrected ? Upvote 0
Roger Daley Well-Known Member Licensed User Longtime User Dec 14, 2020 #4 LucaMs said: When a member does not exist (property or method) you have to use the original view. B4X: #If B4A Dim Disp1 As EditText = Display1 #Else If B4J Dim Disp1 As TextField = Display1 #Else If B4I ' I don't know, not having B4I; it shoud be the same of B4J #End If Disp1.SelectionStart = Disp1.Text.Length Click to expand... LucaMs, Amazing, you've given me the answer but not one I would have ever had guessed. Many Thanks Roger. Upvote 0
LucaMs said: When a member does not exist (property or method) you have to use the original view. B4X: #If B4A Dim Disp1 As EditText = Display1 #Else If B4J Dim Disp1 As TextField = Display1 #Else If B4I ' I don't know, not having B4I; it shoud be the same of B4J #End If Disp1.SelectionStart = Disp1.Text.Length Click to expand... LucaMs, Amazing, you've given me the answer but not one I would have ever had guessed. Many Thanks Roger.