Solved

Combo box, (style = CsDropdownlist) show default value

Posted on 2000-02-17
8
1,693 Views
Last Modified: 2008-02-20
Hi,

I am using delphi 3.02

I have a combo box with a fixed known number of values (these are the ONLY valid values, so I have made the type CsDropDownList).

When I display the combo box I want a defuault value already shown, but currently it just shows blank until you select a value. I have tried code like combobox1.text := 'Default'; but still it initially shows a blank value. Is there anyway of overcoming this, or is this just the way the combo box of this type works?

Thanks
Clyde
0
Comment
Question by:clyde99
  • 4
  • 3
8 Comments
 

Author Comment

by:clyde99
ID: 2533592
Addendum:

The code combobox1.text := 'Default';
works for all other types of combo boxes, except the CsDropDownList and unfortunately this is the type of combo box I really want to use.
0
 
LVL 6

Expert Comment

by:edey
ID: 2533707
You can set the comboBox's itemIndex property in the parent form's OnCreate handler.

GL
Mike
0
 

Accepted Solution

by:
adpearce earned 50 total points
ID: 2533774
clyde,

Use the Combox's Items IndexOf property to select the index of the element you want.  Then just set the ItemIndex to the value returned:

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

regards,
Ant.
0
 
LVL 6

Expert Comment

by:edey
ID: 2535385
hmmmm....
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:clyde99
ID: 2539425
what is the hmmmm.... for edey ????
0
 
LVL 6

Expert Comment

by:edey
ID: 2540373
It is not generally cosidered polite to "rehash" someone else's comment as an answer


GL
Mike
0
 

Author Comment

by:clyde99
ID: 2540695
Mike,

Sorry. This is partly my fault. I considerd both answers to be correct, but when I looked at them adpearce was before yours, no I naturally assumed he had answered first and awarded the points.

My apologies, I should have had a closer look at the TIME.

Regards
Clyde
0
 
LVL 6

Expert Comment

by:edey
ID: 2540742
Hey no problem, the idea here is simply to lend a helping hand, perhaps to expect the same at a later date :)  Glad to here that you were able to find an acceptable solution :)

GL
Mike
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
delphi prevent click fast 2 191
How to create virtual printer while installing my application 5 24
CheckListBox usage 3 51
Multi-layered image in FireMonkey 9 18
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now