Finding an item in ListCtrl
-
Hi, In order to find an item in a ListCtrl i am using Find method of ListCtrl My code snippet is : CString sText="something"; LVFINDINFO info; info.flags = LVFI_PARTIAL | LVFI_STRING ; info.psz =(LPCSTR) sText; int nIndex = FindItem(&info); //it is always returning 0 even not -1 o indicate that the item is not in the list.I can see my item with the text in ListView but It can not find the item... Any ideas that can put some light... with greetings from Germany Özgür
-
Hi, In order to find an item in a ListCtrl i am using Find method of ListCtrl My code snippet is : CString sText="something"; LVFINDINFO info; info.flags = LVFI_PARTIAL | LVFI_STRING ; info.psz =(LPCSTR) sText; int nIndex = FindItem(&info); //it is always returning 0 even not -1 o indicate that the item is not in the list.I can see my item with the text in ListView but It can not find the item... Any ideas that can put some light... with greetings from Germany Özgür
If FindItem returns 0, first item in your list contains 'something'. Item numbers are 0-based. Tomasz Sowinski -- http://www.shooltz.com