0
所以我寫了一個重新排列列表視圖的列表(實際上只是 - = 1和+ = 1是所選列表視圖列的顯示索引,但是當我移動列時,子項仍然存在,它們不會移動。想對應的子項與列移動。如何重新排列listviewitem的子項目?
main.listView1.Columns[listBox1.SelectedIndex].DisplayIndex += 1;
listBox1.Select();
listBox1_SelectedIndexChanged(sender, e); //the code for moving the column to the right
main.listView1.Columns[listBox1.SelectedIndex].DisplayIndex -= 1;
listBox1.Select();
listBox1_SelectedIndexChanged(sender, e); //the code for moving the column to the left
決不再用頭腦,我只是意識到愚蠢的列表視圖具有拖放列表視圖重新排序功能。抱歉。 –