Rather than assign the text property :

(1) Populate the combo with your items (Just as you would a StringList).
(2) Then to display the default value set the ItemIndex property. If you
want to display Tuesday, and the first item in the list is Sunday  then the
itemindex needs to be set to 2 (0 IS THE FIRST ITEM ... COMBOBOX1.ITEMINDEX
:= 2). If you don't know what number item you need, but know the string
value I am sure the combobox has a method to return ItemsIndex of that item.

I haven't used the combobox text propert but imagine you'd use it to select
substrings and to visibly manipulate the displayed item. Assigning to the
text property is probably not much different to trying to type the value in
by hand (not valid for read only).      

-----Original Message-----
From: Ross Levis [mailto:[EMAIL PROTECTED]]
Sent: 3 August 2001 10:51
To: Multiple recipients of list delphi
Subject: Re: [DUG]: ComboBox help


Thanks for your reply.

Yes I realise that but what I need to do is store the chosen selection (in a
text file), which happens to be a day of the week -- Monday - Sunday, and
next
time they load the app I want to default the ComboBox to the previous
setting.
I don't want the user typing in anything.  Is it not possible?  I thought it
would be common practice.

Cheers,
Ross.

Patrick Dunford wrote:

> The DropDownList style is for a fixed list of items. The Text property
only
> applies to the style of combobox where the user can actually type text in
at
> the top and it doesn't have to be an item in the list. with DropDownList
the
> item they choose has to be one in the list so they can't type in something
> that isn't in the list.
>
> > -----Original Message-----
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> > Behalf Of Ross Levis
> > 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/
---------------------------------------------------------------------------
    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