ListView Item Activation Question

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
 
T

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top