Find item I double-clicked in ListView and read contents

  • Thread starter Thread starter Chris LaJoie
  • Start date Start date
C

Chris LaJoie

here's how its done:

private void lv_DoubleClick(object sender, System.EventArgs e)
{
if(lv.SelectedItems.Count > 0)
{
lv.SelectedItems[0].SubItems[4].Text = "testing";
}
}

also, use the FullRowSelect property on the listview (I'm pretty sure htats
what you're looking for)

Chris
 
Is there a way I can find out which item I double-clicked inside a listview?
And what about with subitems? And once I get an item number, can I use it to
read the item and subitem contents?
And if I click on one item, what do I need to do in order for me to
highlight that item I clicked in the following X items?
Since I'll be displaying addressses in the listbox, I'd like to be able to
highlight the whole address when the user clicks on the name.

Thank you again,
Angel
 
Back
Top