Posted on 2000-03-29
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 20 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor ( Top Charts is a view in which you can set seve…

705 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