ListView Item Activation Question

  • Thread starter Thread starter Tom
  • Start date Start date
T

Tom

How can I programmatically activate an item in a ListView?
I'm using a detail view with double click to activate using the mouse.
When I change the font size that forces a refresh of the list ... the
selected item is cleared. I'd like to save the index of the selected
item before changing the font and then re-activate based upon index
value.

Any suggestions much appreciated.

Thanks.

-- Tom
 
After spending way too much time searching for the answer ... I
decided to post the question here about ListView programmatic item
activation. Sure enough, within a couple minutes after posting I found
the answer in the doco. Here's the method >>

int hold = this.listView1.SelectedItems[0].Index;

{ change font size forcing a refresh and clearing of Selected Items }

this.listView1.Focus();
this.listView1.Items[hold].Selected = true;

My appologies for the posting. I am amazed how difficult it is for me
to find the simplest things within the documentation. Am I the only
one with doco searching stupidity syndrome? :(

-- Tom
 
Back
Top