自分のクラスのオブジェクトを含む配列リストがあります。listview の index = selectedindex を持つ配列リストからオブジェクトをフェッチしたい。
私はこれを試しました:
TrackInformation t=(TrackInformation) SongList[listView1.SelectedIndices[0]];
TrackInformationは私のクラスでありSongList、タイプの ArrayList ですTrackInformation。
listview1 では複数のインデックスを選択できないため、SelectedIndicesコレクションの最初の要素が必要です。
私は取得ArgumentOutOfRangeExceptionしていますが、「0」の値は「インデックス」には無効です。