Get the item doubleclick event of listview

后端 未结 16 1480
没有蜡笔的小新
没有蜡笔的小新 2020-12-01 02:17

What do I need to do in order to reference the double click event for a listview control?

16条回答
  •  醉话见心
    2020-12-01 02:32

    I don't yet have a large enough reputation score to add a comment where it would be most helpful, but this is in relation to those asking about a .Net 4.5 solution.

    You can use the mouse X and Y co-ordinates and the ListView method GetItemAt to find the item which has been clicked on.

    private void ListView_MouseDoubleClick(object sender, MouseButtonEventArgs e)
    {
        ListViewItem item = myListView.GetItemAt(e.X, e.Y)
        // Do something here
    }
    

提交回复
热议问题