By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,679 Members | 1,063 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,679 IT Pros & Developers. It's quick & easy.

Selecting and Focusing a ListViewItem?

P: n/a
I am trying to select and focus single ListViewItem and can't seem to do so,
here is my code:

IEnumerator * itemList = mLsvMyList->Items->GetEnumerator();
while (itemList->MoveNext())
{
ListViewItem * currentItem =
static_cast<ListViewItem*>(itemList->Current);
String * tagData = static_cast<String*>(currentItem->Tag);
if(verString->Equals(tagData))
{
static_cast<ListViewItem*>(itemList->Current)->Focused = true;
static_cast<ListViewItem*>(itemList->Current)->Selected = true;
mLsvMyList->Select();
}
}

What I end up with is there are three items in the list the first one is
focused and the last item is selected. Anyone know what I am not doing
correctly?

Thanks!
Nov 17 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.