2

What is the best way to set key/value pairs in a combo box?

For example I want to set:

  1. Key: T1 Value: test 1
  2. Key: T2 Value: test 2
  3. Ecc...
Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
Marco R.
  • 21
  • 4

1 Answers1

2

The TComboBox.Items property is a TStrings, which has AddPair() and AddObject() methods that allow you to associate a TObject value with each string. You can use that TObject to store whatever you want.

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770