문제

I'm using a textbox on my Windows Phone 8 app. I want that the first character which will be insert by the user will be in upper case.

        if (str.Length == 1)
            str = str.ToUpper();

I've tried to handle TextChanged event on Textbox with the above code, but the cursor will move to the first position, so I can't insert more text at the right place.

So, how can I make the first letter of textbox to upper case?

도움이 되었습니까?

해결책

You should set the InputScope property to Text. The first character will automatically be inserted in upper case, and the TextBox will get auto-correction, suggestions, and emoticons.

<TextBox InputScope="Text" />
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top