Combobox

In a dropdown combobox I have 3 values (TStrings).How do I make one appear by default when the form gets displayed i.e combobox???
SendoAsked:
Who is Participating?
 
simonetConnect With a Mentor Commented:
In the form's OnCreate or OnShow event, add this line:

ComboBox1.itemindex := 1; { or whatever is the itemindex # of the item you want as default }

Yours,

Alex
0
 
SendoAuthor Commented:
Are you sure there is no another way?
Just asking ....
0
 
simonetCommented:
Yes, Sendo, I am sure. Unless you're willing to create a component that's a derivative from TCustomComboBox, and add an ItemIndex property to it, but that's even more trouble and hassle than what I've already suggested.

Yours,

Alex
0
 
DrDelphiCommented:
I would have to disagree, but it is really only a techinicality. You can set the ComboBox's TEXT property to read anything you like without it having to be an item in it's strings property.

0
All Courses

From novice to tech pro — start learning today.