To extend the answer to @CharithJ, you should use the tag property:
ListView allCardsListView = new ListView(); ListView selectedCardsListView = new ListView(); List<Card> allCards = new List<Card>(); List<Card> selectedCards = new List<Card>(); public Form1() { InitializeComponent(); foreach (Card selectedCard in selectedCards) { ListViewItem item = new ListViewItem(selectedCard.Name); item.Tag = selectedCard; selectedCardsListView.Items.Add(item); } foreach (Card card in allCards) { ListViewItem item = new ListViewItem(card.Name); item.Tag = card; allCardsListView.Items.Add(new ListViewItem(card.Name)); } Button button = new Button(); button.Click += new EventHandler(MoveSelectedClick); } void MoveSelectedClick(object sender, EventArgs e) { foreach (ListViewItem item in allCardsListView.SelectedItems) { Card card = (Card) item.Tag;
Obviously, you will need to adapt it to your own code, but this should help you get started.
Davy8 source share