473,323 Members | 1,537 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,323 software developers and data experts.

Selecting and Focusing a ListViewItem?

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
0 1057

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Paddy | last post by:
How do I select a subitem from a listview after clicking on the first column? Couldn't find it in MSDN. Thank you. Paddy.
10
by: Danny Tuppeny | last post by:
Hi All, I'm trying to find the best way to select an item in a ListView using the Virtual mode. My "items" are business classes, and I have a reference to once I want to select (passed from...
6
by: grs | last post by:
The following is a code example from the Microsoft MSDN. My question is on the following three lines of code: ListViewItem item1 = new ListViewItem("item1",0); ListViewItem item2 = new...
2
by: Fritz | last post by:
I know it, I know it. It's come up a lot. I've done the Googling, but the standard answer doesn't do what I expect it to. For the record, the standard answer is: "Set the Selected property of a...
3
by: larry mckay | last post by:
anyone have the code to select and listview item or row (subitems) after a doubleclick event from a listview. *** Sent via Developersdex http://www.developersdex.com *** Don't just participate...
3
by: Lars Netzel | last post by:
It seems like the ListView.SelectedItems is a ReadOnly Property.. How do I after a "populate" of a ListView preselect one or more Items? /Lars
4
by: Mark Rae | last post by:
Hi, I have a bog-standard ListView control in a v1.1 C# WinForms project, with three colums, Details View. There is "Select All" button under the ListView control with the following code: ...
0
by: garyusenet | last post by:
I am trying to create a form that will display a list of open internet explorer windows and allow the user to choose one of them. So far I have created an arraylist which contains all of the open...
13
by: deciacco | last post by:
How can I have access to the items collection of a listview control on my form from a background thread? I know I need delegates to update the listview control and I have those calls in the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.