Change keyboard type according to cursor position

How to make?
In a text box, when the cursor is in the fifth position, the keyboard must contain only numbers. In other houses, alphanumeric keyboard. Thanks!

Use the TextBox by Taifun extension. In the text changed event, check the cursor position if the cursor is at position 5, set NumbersOnly property to true, if the cursor position is other, set NumbersOnly property to false.
https://puravidaapps.com/textbox.php

I have not tested this solution, so I do not know if it will work and what the effect will be. Check this and give a feedback.

did not work, when it gets to the position the text goes crazy

Trying doing the same thing but instead of checking the cursor position check the text length and if it's >5 set it to numbers only

Try this

Actually my idea does not work because when you switch the keyboard the cursor goes back to position 1 and the keyboard changes back to alphanumeric. Another idea is to have two text boxes side by side, one text box, one numeric one, and automatically move from one box to another.

it worked like this



I used both extensions: TaifunTextBox and TextBoxTools

thank you all!!!

1 Like

So the idea was good, except that the built-in InputType change functions don't work as expected and reposition the cursor.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.