【问题标题】:Item Right Tapped in ListView WPFListView WPF中点击的项目
【发布时间】:2015-10-13 20:00:25
【问题描述】:

有没有办法让 ListView 或 GridView 上的 OnItemRightTapped 事件与 ItemClick 完全一样,除了显然只在右击时做出反应?

【问题讨论】:

    标签: wpf listview right-click onitemclick


    【解决方案1】:

    您可以为鼠标按下添加事件处理程序,然后在代码中确定点击源:

        private void listView_MouseDown(object sender, MouseButtonEventArgs e)
        {
            if (e.ChangedButton == MouseButton.Right)
            {
                // Do what u need to do here
            }
            else
                e.Handled = true;            
        }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-07-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多