Jump to content
bazzer747

Combobox Value pairs

Recommended Posts

Hi

I often use the Value pairs in a combo box, and can easily get the 'value' from the current index. I also use IndexOf to check if a certain item is in the list, but that checks the Name side not the Value side.

Is there a way to check if an item is in the Value side of a combobox? 

Share this post


Link to post

I don't think there is.  

 

20 hours ago, bazzer747 said:

I also use IndexOf to check if a certain item is in the list, but that checks the Name side

IndexOf checks the whole item including the NameValueSeparator. Presumably you mean IndexofName.

 

You can use ValueFromIndex to iterate through each of the items in the TStrings:

 

for i := 0 to myList.count-1 do
  if myList.ValueFromIndex='myvalue' then 
	begin
	 //Got it
	 break;
	end;

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×