Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
選択したものではなく、特定の場所のリストボックスからアイテムを削除するにはどうすればよいですか?
リストボックスに4つのアイテムがあり、インデックス2のアイテムを削除したい場合、選択せずに削除するにはどうすればよいですか。
ListBox.Itemsはリストである必要があります。より正確にはListBox.ObjectCollection
やってみました :
myListBox.Items.RemoveAt(2);
MSDNのRemoveAtrefference
listBox1.Items.RemoveAt(position);
ListBox1.Items.RemoveAt(anyindex);