Board index » cppbuilder » Set text in TComboBox

Set text in TComboBox

I Use Builder 3.0.
I need to set a run-time the value of Text in a ComboBox when the syte
is csDropDownList. How can I do this?
If I modify Text or ItemIndex none is show in the combo box.
Thanks
Teo
 

Re:Set text in TComboBox


Quote
"Teo" <teo....@tiscalinet.it> wrote in message

news:3C04DE0A.4050001@tiscalinet.it...

Quote
> I Use Builder 3.0.
> I need to set a run-time the value of Text in a ComboBox when the syte
> is csDropDownList. How can I do this?

If you want to select an item that has already been added to the
TComboBox->Items,
use ComboBox1->ItemIndex = ComboBox1->Items->IndexOf("SomeText") ;

Re:Set text in TComboBox


Quote
Teo wrote:
> I Use Builder 3.0.
> I need to set a run-time the value of Text in a ComboBox when the style
> is csDropDownList. How can I do this?
> If I modify Text or ItemIndex none is show in the combo box.

If you look in the win32.hlp index under topic "Combo Box Types and
Styles," you will see that a Combo Box with style CBS_DROPDOWNLIST
does not have an Edit control.  It looks like you will have to put it there
yourself...

Other Threads