如何在Windows Phone 7中突出显示焦点上的文字?

时间:2010-12-01 02:30:01

标签: windows-phone-7

如何突出显示Windows Phone 7中TextBox控件中的文本?我在控件上找不到属性设置。

在代码隐藏中处理OnFocus事件是唯一的选择吗?

2 个答案:

答案 0 :(得分:2)

您可以使用TextBox.Select(int start,int length)突出显示文本。

答案 1 :(得分:1)

实际上有一个非常好的附加属性可以用来做到这一点。您可以查看解决方案of auto selecting text in a textbox的原始说明,还可以查看a project where I made user of it