For the wpf listview , in the Mouse Over event how do i get a reference to the item that the mouse cursor is on开发者_如何学Go ?
Regards, MadSeb
You have to use the MouseOver event from the listViewItem that the mouse is over, not the one from the listview itself.
public MainWindow() {
    InitializeComponent();
    ListView listView = new ListView();
    ListViewItem listViewItem = new ListViewItem();
    listViewItem.MouseMove += myMouseMoveEvent;
    listView.Items.Add(listViewItem);
}
private void myMouseMoveEvent(object sender, MouseEventArgs e) {
    ListViewItem item = (ListViewItem) sender;
    // now you can handle the events with this item....
}
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论