Solved

Combobox

Posted on 2000-03-29
4
352 Views
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???
0
Comment
Question by:Sendo
  • 2
4 Comments
 
LVL 15

Accepted Solution

by:
simonet earned 20 total points
Comment Utility
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 }

Yours,

Alex
0
 

Author Comment

by:Sendo
Comment Utility
Are you sure there is no another way?
Just asking ....
0
 
LVL 15

Expert Comment

by:simonet
Comment Utility
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.

Yours,

Alex
0
 
LVL 6

Expert Comment

by:DrDelphi
Comment Utility
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.

0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

771 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

13 Experts available now in Live!

Get 1:1 Help Now