Thanks Roser. I scanned the properties & didn't see ItemIndex the first time,
but later I did discover it. This is the first ComboBox I've used.
Is there is something wrong with the list? This mail just arrived Sunday night
but was sent on Thursday!
Cheers,
Ross.
There is something
"Roser, Wayne" wrote:
> I locate the value I want in the list and set the itemindex property, all in
> code. Something like:
>
> FoundPos := ComboBox1.Items.IndexOf(StringToFind);
> if FoundPos > -1 then begin //teacher found
> ComboBox1.ItemIndex := FoundPos;
> end else begin
> ComboBox1.ItemIndex := 0;
> end;
> ComboBox1Click(nil);
>
> > -----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/
---------------------------------------------------------------------------
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/