Clickable ListViewItems in a ListView

  • Thread starter Thread starter illegal.prime
  • Start date Start date
I

illegal.prime

Hi all, I have a Form (FormA) that contains a ListView. Recently,
we've decided to add elements (ListViewItems) to this ListView that can
be "activated" (probably a single or double click with the mouse) by
the user. This "activation" will spawn a new Form (FormB)- in which
the user selects something else and then returns to the original FormA
with the ListView. When they return to FormA, the ListViewItem that
they activated will have changed its text to match something that the
user had chosen in the window that was spawned.

Right now I think I will just make the font of the text on these
particular ListViewItems blue and underlined (like a hyperlink), create
an event handler for the entire ListView for Click or DoubleClick and
then determine whether the user clicked on a ListViewItem that requires
the new Form (FormB) to be spawned.

Once the user makes a selection in the new Form (FormB), they can they
click OK, then this will update the text in the original form (FormA).
I think I can do this update by getting the original ListViewItem's
index, removing it and then adding a new item at the same index.

Does this make sense? Is there a better way of doing this?

Thanks,
Novice
 
Update the original ListViewItem instad of removing it and adding a new one

/claes
 
Ah - thanks for the advice, I wasn't sure if I could do that, but that
makes sense.

Novice
 
Back
Top