日期:2014-05-17  浏览次数:21520 次

WPF,怎样去掉ListBox的右键选中项
对于ListBox而言,鼠标右击项的时候,也会选中项,请问怎样去掉这个功能,我只想鼠标左键点击选中项。

------解决方案--------------------
        private void listBox1_PreviewMouseDown(object sender, MouseButtonEventArgs e)
        {
            if (e.RightButton == MouseButtonState.Pressed)
                e.Handled = true;
        }