Problems with selected indices in listview

前端 未结 3 867
天涯浪人
天涯浪人 2021-01-15 18:21

I have an arraylist which contain objects of my own class. I want to fetch the object from the array list which has the index = selectedindex of listview.

I tried th

3条回答
  •  执笔经年
    2021-01-15 18:54

    Put this line before your code -

    if(listView1.SelectedIndices.Count > 0)
    {
       TrackInformation t=(TrackInformation) SongList[listView1.SelectedIndices[0]];
    }
    

提交回复
热议问题