[英]How to set TextBox cursor on the rigth corner of the TextBox
You can use HorizontalContentAlignment
property: 您可以使用HorizontalContentAlignment
属性:
<TextBox HorizontalContentAlignment="Right" VerticalAlignment="Top"/>
The result: 结果:
If you want to set the Caret position, you have to play with CaretIndex
property,for example: 如果要设置插入符号位置,则必须使用CaretIndex
属性,例如:
<TextBox Text="Username" CaretIndex="0"/>;
But as @NicoRiff says in a comment, what you probably want is a PlaceHolder. 但是正如@NicoRiff在评论中所说,您可能想要的是PlaceHolder。 If that's the case, see this question 如果是这样,请参阅此问题
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.