首页 > 其他分享 >WPF-TreeView行选中效果

WPF-TreeView行选中效果

时间:2023-01-10 15:46:51浏览次数:38  
标签:MouseButtonState 选中 Pressed WPF TreeView treeViewItem

        private void trvw_MouseDown(object sender, MouseButtonEventArgs e)
        {
            if (e.Source is TreeViewItem treeViewItem)
            {
                if (e.RightButton == MouseButtonState.Pressed || e.LeftButton == MouseButtonState.Pressed)
                {
                    treeViewItem.IsSelected = true;
                }
            }
        }

标签:MouseButtonState,选中,Pressed,WPF,TreeView,treeViewItem
From: https://www.cnblogs.com/qq2806933146xiaobai/p/17040488.html

相关文章