dimanche 7 mars 2021

Getting checked items in listView and putting their tags in listBox

I have this code attached to a button:

        listBox1.Items.Clear();
        foreach (ListViewItem item in listView1.CheckedItems)
            listBox1.Items.Add(item);

It takes any checkboxed items in a listView and puts them in a listBox. But I want to use tags instead of names because currently it shows as:

{listViewItem}: "item name"

I only want the item name and not the prefix so can this be done efficiently?

edit: in C# winform




Aucun commentaire:

Enregistrer un commentaire