If you want to assign a value to a ComboBox with a Style of csDropDownList
you have to do it using the ItemIndex property.

e.g. if you have a list 

Fred
Teddy
Mountain

and you want to assign 'Teddy' to the combo box you will need to do the
following.

ComboBox1.ItemIndex := ComboBox1.Items.IndexOf('Teddy');



Steve

-----Original Message-----
From: Ross Levis [mailto:[EMAIL PROTECTED]]
Sent: Thursday, 2 August 2001 13:36
To: Multiple recipients of list delphi
Subject: [DUG]: ComboBox help


I must be missing something.

I need a ComboBox which is ReadOnly but also allows the text (or
selected item) to be assigned via code.  eg. Providing a default.
Currently when Style is csDropDownList, the Text property can not be
assigned.  What am I missing!

Cheers,
Ross.

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/

Reply via email to