zhoumy博客(C#、Windows Phone XAML)

关于WPF中TextBox使用SelectAll无效的问题的解决办法

1.首先保证你设置的SelectionBrush不是透明的颜色或者和背景色相同

2.在使用SelectAll之前要保证Textox以及获取到焦点。

this.textbox.SelectionBrush = Brushes.Blue;
this.textbox.Focus();
this.textbox.SelectAll();

 

posted @ 2014-10-20 14:47  zhoumy  阅读(1023)  评论(0编辑  收藏  举报
zhoumy博客(C#、Windows Phone XAML)