Search Combo or List by ItemData

Started by Peter House, December 23, 2010, 01:40:04 PM

Previous topic - Next topic

Peter House

Is there a way to search a Listbox or ComboBox for the first Match by ItemData instead of by text ???

How About searching a ListView by ItemData or SubItem lParam?

Thanks,

Peter House

Paul Squires


'--------------------------------------------------------------------------------
Function ItemInListBox( ByVal hListBox As Dword, ByVal nItem As Long ) As Long
   
   Local nFound As Long
   Local nCount As Long
   Local i      As Long
   
   nFound = -1
   
   nCount = FF_ListBox_GetCount( hListBox )
   
   For i = 0 To nCount - 1
      If FF_ListBox_GetItemData( hListBox, i ) = nItem Then
         nFound = i
         Exit For
      End If
   Next

   Function = nFound

End Function

Paul Squires
PlanetSquires Software