With csDropDown, the Text property is largely independent of the item
selected in the drop down list. So you could select an item and then type
something that's not in the list. You should use

iIndex := DocEntryDestCB.Items.IndexOf(ImpDestCode);
if iIndex <> -1 then
     DocEntryDestCB.Text := DocEntryDestCB.Items[iIndex];

Deepak Shenoy
Agni Software
http://www.agnisoft.com

----- Original Message -----
From: "Mark Howard" <[EMAIL PROTECTED]>
To: "Multiple recipients of list delphi" <[EMAIL PROTECTED]>
Sent: Tuesday, December 19, 2000 6:08 AM
Subject: [DUG]: ComboBox List Index


Hi all

With a TComboBox Style set at csDropDownList you can do:

                DocEntryDestCB.ItemIndex :=
DocEntryDestCB.Items.IndexOf(ImpDestCode);

With the Style set at csDropDown, you can't.

Why is this? and is there a way to achieve the same thing - without chaging
the style of the TComboBox?

TIA

Mark



---------------------------------------------------------------------------
    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"

Reply via email to