- This topic has 2 replies, 2 voices, and was last updated 2020-06-22 at 8:06 am by .
Viewing 2 reply threads
Viewing 2 reply threads
- You must be logged in to reply to this topic.
Home › Forums › Konopka Signature VCL Controls (formerly Raize Components) › Combobox IndexOf
Hi
I often use the Value pairs in a combo box, and easily get the ‘value’ from the current index. I have also used the 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?
Hi Barry,
You can use the Values string list and use the IndexOf method on that to get the index of the item that contains the value you are looking for.
procedure TForm25.RzButton1Click(Sender: TObject);
var
Idx: Integer;
begin
Idx := RzComboBox1.Values.IndexOf( 'SomeValue' );
RzComboBox1.ItemIndex := Idx;
end;
Ray
As ever, thanks Ray.
We use cookies to improve your experience on our site. By using our site, you consent to cookies.
Manage your cookie preferences below:
Essential cookies enable basic functions and are necessary for the proper function of the website.
These cookies are needed for adding comments on this website.
These cookies are used for managing login functionality on this website.
Stripe is a payment processing platform that enables businesses to accept online payments securely and efficiently.
Service URL: stripe.com (opens in a new window)