2
votes

Im usin the default textbox. My requirement is ,i dont want the keyboard to appear ever on textbox. user rather modify text from other button of my gui.

But i want user to have the option to select the caret index and move it so that they can select the position of entering text.

so,to stop keyboard from appearing,ive made the textbox readonly. but i can not get it to show the caret index in readonly mode.

I saw in .net framework textbox,there is a property called iscaretvisibleinreadonly mode. but nothing like this in windows phone textbox.

1

1 Answers

0
votes

You'll need to build your solution without using a TextBox if you want to not show a keyboard. For a consistent, cross-application experience, the keyboard always shows on the Windows Phone and is not programmatically controllable.

A similar question was asked recently, but the answers weren't accurate.

The best answer at this time may be to consider an alternate UI for your application.

However, a hack would be to try to emulate the basics by using a TextBlock. You'd need to measure the location of each character and when the TextBlock is tapped, place a rectangle in between two characters (and then start it blinking by using an animation). If the text may not fit though, the complexity increases, as does the opportunity for edge cases. Further, you'll likely want to handle operations like copy and paste from the text field.

As your comments indicate that you want to build a telephone dialer keypad, I'd suggest you instead consider using:

<TextBox InputScope="TelephoneCountryCode" />

The results will look similar to this:

Telephone Keypad on Windows phone

There are other options as well for telephone keypads documented here.

As this dialer keypad would be a standard experience for Windows Phone users, they wouldn't need to learn another keypad within your application and it's nuances.

Using Google Voice on iOS for example, they've chosen to implement their own keypad. However, you may notice they don't support positioning the text-input cursor. A user can paste a number and delete digits.