对tb运用相同的事件,错误ImplementQuntity_IsMouseCapturedChanged的重载

.Net技术 码拜 8年前 (2016-03-05) 848次浏览
private void self_Loaded(object sender, RoutedEventArgs e)
        {
            tb.IsMouseCapturedChanged += new EventHandler(ImplementQuntity_IsMouseCapturedChanged);
        }
        private void ImplementQuntity_IsMouseCapturedChanged(object sender, DependencyPropertyChangedEventArgs e)
        {
            if (ImplementQuntity.Text.Length > 0)
            {
                int a = ImplementQuntity.Text.IndexOf("+", ImplementQuntity.SelectionStart);
                if (a > 0)
                {
                    int b = ImplementQuntity.Text.LastIndexOf("+", a - 1);
                    ImplementQuntity.Select(b + 1, a - b - 1);
                }
                else if (a == -1)
                {
                    int b = ImplementQuntity.Text.LastIndexOf("+");
                    ImplementQuntity.Select(b + 1, ImplementQuntity.Text.Length);
                }
                double s = Convert.ToDouble(ImplementQuntity.SelectedText);
                if (FindTreeViewItem(element, s) != null)
                    FindTreeViewItem(element, s).IsSelected = true;
            }
        }
解决方案

20

该回复于2016-06-03 13:28:10被管理员删除

CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明对tb运用相同的事件,错误ImplementQuntity_IsMouseCapturedChanged的重载
喜欢 (0)
[1034331897@qq.com]
分享 (0)