I have a ListBox with SelectionMode="Multiple", which allows me to select multiple rows by clicking either the left or right mouse buttons. How can I restrict the selection to occur from the LEFT mouse button click only?
+1
A:
I guess you have to write your own ListBox(Item), override the
protected override void OnPreviewMouseRightButtonDown(MouseButtonEventArgs e)
{
base.OnPreviewMouseRightButtonDown(e);
}
or
protected override void OnMouseRightButtonDown(MouseButtonEventArgs e)
{
base.OnMouseRightButtonDown(e);
}
EventHandler and use your custom ListBox(Item) in your xaml. Don't forget to call e.Handled = true; you probably can also use one of the more general mouse event handlers and check if the right mouse button has been clicked and then call e.Handled.
Torsten
2009-05-14 14:47:34