G
Guest
I was wondering how I can use a listview effectively in managed c++
..net. Basically I'm trying to get the index of the selected item in
the list view, then get the "tag" attribute of that item to invoke
data in other area of my app.
Here's some example code:
//////////////////////////////////////
private: System::Void lstTeams_SelectedIndexChanged(System::Object *
sender, System::EventArgs * e)
{
int index = lstTeams->SelectedIndices->get_Item(0);
}
//////////////////////////////////////
That's basically just assigning the index of my selected item to int
"index". Is this correct? When I go to my form and change to a
different item in my listview box, I get a "Specified argument was out
of range of valid values". Also, it APPEARS that when I change to a
different item in my listview, lstTeams_SelectedIndexChanged fires
TWICE. Any idea why?
I've been working of this project lately, and these .NET GUI controls
are really binding me.
Thanks,
Kyle
..net. Basically I'm trying to get the index of the selected item in
the list view, then get the "tag" attribute of that item to invoke
data in other area of my app.
Here's some example code:
//////////////////////////////////////
private: System::Void lstTeams_SelectedIndexChanged(System::Object *
sender, System::EventArgs * e)
{
int index = lstTeams->SelectedIndices->get_Item(0);
}
//////////////////////////////////////
That's basically just assigning the index of my selected item to int
"index". Is this correct? When I go to my form and change to a
different item in my listview box, I get a "Specified argument was out
of range of valid values". Also, it APPEARS that when I change to a
different item in my listview, lstTeams_SelectedIndexChanged fires
TWICE. Any idea why?
I've been working of this project lately, and these .NET GUI controls
are really binding me.
Thanks,
Kyle