You can use HorizontalContentAlignment
property:
<TextBox HorizontalContentAlignment="Right" VerticalAlignment="Top"/>
The result:
If you want to set the Caret position, you have to play with CaretIndex
property,for example:
<TextBox Text="Username" CaretIndex="0"/>;
But as @NicoRiff says in a comment, what you probably want is a PlaceHolder. If that's the case, see this question
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.