wxListBox::FindString issue
wxListBox::FindString issue
In the documentation of wxListBox::FindString There is: "Finds an item whose label matches the given string.", but what if there are more then 1 item with such label? I gues it returns the very first item with that label, posibly I am wrong, but how to get the other items with that lebel?
- xaviou
- Super wx Problem Solver
- Posts: 437
- Joined: Mon Aug 21, 2006 3:18 pm
- Location: Annecy - France
- Contact:
Re: wxListBox::FindString issue
Hi
Regards
Xav'
You're right.gtafan wrote:I gues it returns the very first item with that label
You'll have to make the search yourself :gtafan wrote:how to get the other items with that lebel?
Code: Select all
int iCount = myListBox->GetCount();
for (int i=0; i<iCount; ++i)
{
if (myListBox->GetString(i) == _T("Searched string"))
{
// Do what you want with the item at index i
}
}
Xav'
My wxWidgets stuff web page : X@v's wxStuff