[Gambas-user] ComboBox.Find (gb.qt) syntax
Benoît Minisini
gambas at ...1...
Fri Oct 2 14:20:26 CEST 2009
> ComboBox.Find (gb.qt)
> Syntax
>
> FUNCTION Find ( Item AS String ) AS Integer
>
> Finds an element in the poup list box and returns its index, or -1 if the
> element cannot be found.
>
>
> This appears to be case sensitive which is a pity.
>
> I wonder if it would be possible to have a flag in this routine to search
> for case sensitive/non sensitive
>
> Regards
>
> Richard
>
You must do it yourself:
Sub Find(hCombo As ComboBox, Item As String) As Integer
Dim iInd as integer
For iInd = 0 to hCombo.Count - 1
If String.Comp(hCombo[iInd].Text, Item, gb.IgnoreCase) = 0 then return iInd
Next
Return -1
End
--
Benoît Minisini
More information about the User
mailing list