Hi guys, I just thought I would add this because it was a pain for me to muster up
due to the lack of information through google and msdn on the topic. Enjoy =)
Retrieve String from Checked Items in a ListView Control
private void Button1_Click(object sender, EventArgs e)
{
///////////////////////////////////////////Retrieve total number of Checked Boxes
int i = listView1.CheckedItems.Count;
string []sTemp = new string[i];
ListView.CheckedIndexCollection k = listView1.CheckedIndices;//////////Retrieve Index number of boxes that are Checked
for (int n = 0; n < listView1.CheckedItems.Count; n++)
{
sTemp[n] = listView1.Items[k[n]].Text; //////////Cycle through index numbers of Checked processes and add to string array
}
}
Geekitygeek 480 Nearly a Posting Virtuoso
LevyDee 2 Posting Whiz in Training
Geekitygeek 480 Nearly a Posting Virtuoso
LevyDee 2 Posting Whiz in Training
Geekitygeek 480 Nearly a Posting Virtuoso
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.