Posted on 2000-03-29
Medium Priority
Last Modified: 2010-04-04
In a dropdown combobox I have 3 values (TStrings).How do I make one appear by default when the form gets displayed i.e combobox???
Question by:Sendo
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
LVL 15

Accepted Solution

simonet earned 60 total points
ID: 2667772
In the form's OnCreate or OnShow event, add this line:

ComboBox1.itemindex := 1; { or whatever is the itemindex # of the item you want as default }



Author Comment

ID: 2669110
Are you sure there is no another way?
Just asking ....
LVL 15

Expert Comment

ID: 2669385
Yes, Sendo, I am sure. Unless you're willing to create a component that's a derivative from TCustomComboBox, and add an ItemIndex property to it, but that's even more trouble and hassle than what I've already suggested.



Expert Comment

ID: 2670852
I would have to disagree, but it is really only a techinicality. You can set the ComboBox's TEXT property to read anything you like without it having to be an item in it's strings property.


Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

801 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