I iCAB Well-Known Member Licensed User Longtime User Jan 25, 2022 #1 Hi All, When I try setting EditText auto-capitalize on using the code below, the return key disappears: Code: Copy txtb.InputType = txtb.INPUT_TYPE_TEXT txtb.InputType = Bit.Or(txtb.InputType, 16384) Is there a better way of doing this? Thanks iCAB
Hi All, When I try setting EditText auto-capitalize on using the code below, the return key disappears: Code: Copy txtb.InputType = txtb.INPUT_TYPE_TEXT txtb.InputType = Bit.Or(txtb.InputType, 16384) Is there a better way of doing this? Thanks iCAB
Erel B4X founder Staff member Licensed User Longtime User Jan 25, 2022 #2 Have you unchecked the Single Line option in the designer? This code works fine here: Code: Copy Private Sub B4XPage_Created (Root1 As B4XView) Root = Root1 Root.LoadLayout("MainPage") EditText1.InputType = Bit.Or(EditText1.InputType, 16384) End Sub Upvote 0
Have you unchecked the Single Line option in the designer? This code works fine here: Code: Copy Private Sub B4XPage_Created (Root1 As B4XView) Root = Root1 Root.LoadLayout("MainPage") EditText1.InputType = Bit.Or(EditText1.InputType, 16384) End Sub
I iCAB Well-Known Member Licensed User Longtime User Jan 25, 2022 #3 Hi Erel, Thanks for your reply. The control in question was added by code. Upvote 0
I iCAB Well-Known Member Licensed User Longtime User Jan 25, 2022 #4 Sorry Erel, I just noticed the following. It is related to the fact that I am calling the function and passing the original control as a View: B4X: Copy Sub LAY_TextBoxSetAutoCapitalizeFirstLetter( vView As View ) Dim txtb As EditText = vView txtb.InputType = txtb.INPUT_TYPE_TEXT txtb.InputType = Bit.Or(txtb.InputType, 16384) End Sub If I use the code below instead of calling the function, the problem goes away: B4X: Copy txtbOrgControl.InputType = txtbOrgControl.INPUT_TYPE_TEXT txtbOrgControl.InputType = Bit.Or(txtbOrgControl.InputType, 16384) Is there a workaround while using a View as a parameter? Thanks, iCAB Upvote 0
Sorry Erel, I just noticed the following. It is related to the fact that I am calling the function and passing the original control as a View: B4X: Copy Sub LAY_TextBoxSetAutoCapitalizeFirstLetter( vView As View ) Dim txtb As EditText = vView txtb.InputType = txtb.INPUT_TYPE_TEXT txtb.InputType = Bit.Or(txtb.InputType, 16384) End Sub If I use the code below instead of calling the function, the problem goes away: B4X: Copy txtbOrgControl.InputType = txtbOrgControl.INPUT_TYPE_TEXT txtbOrgControl.InputType = Bit.Or(txtbOrgControl.InputType, 16384) Is there a workaround while using a View as a parameter? Thanks, iCAB
Erel B4X founder Staff member Licensed User Longtime User Jan 25, 2022 #5 Correct code is: Code: Copy Sub LAY_TextBoxSetAutoCapitalizeFirstLetter( vView As View ) Dim txtb As EditText = vView txtb.InputType = Bit.Or(txtb.InputType, 16384) End Sub If it doesn't work for you then please upload a small project. Upvote 0
Correct code is: Code: Copy Sub LAY_TextBoxSetAutoCapitalizeFirstLetter( vView As View ) Dim txtb As EditText = vView txtb.InputType = Bit.Or(txtb.InputType, 16384) End Sub If it doesn't work for you then please upload a small project.
I iCAB Well-Known Member Licensed User Longtime User Jan 25, 2022 #6 Works great! Thanks for your help, greatly appreciated! Upvote 0