Solved

setting text property in dropdown list combo box

Posted on 2001-08-15
4
346 Views
Last Modified: 2010-04-06
How do I set text in a "dropdown list" style combo box.

I know how to set it in the normal "dropdown" style combo box. eg.  
                   cmbFields.Text := cmbFields.Items[0];

However, when I do this in the "dropdown list" style combo box, it won't work?????

0
Comment
Question by:aussie_guy_nik
  • 2
4 Comments
 
LVL 3

Accepted Solution

by:
Slavak earned 50 total points
Comment Utility
cmbFields.ItemIndex := 0;
0
 
LVL 4

Expert Comment

by:YodaMage
Comment Utility
This gets more complicated if you are using data aware components. If so, you can set tdbcombobox.itemindex := n;, but once you open/activate the data set, you are going to have a changed result based on field.value. You may have to handle <null> or other field values in the afterscroll event.
0
 
LVL 4

Expert Comment

by:YodaMage
Comment Utility
This gets more complicated if you are using data aware components. If so, you can set tdbcombobox.itemindex := n;, but once you open/activate the data set, you are going to have a changed result based on field.value. You may have to handle <null> or other field values in the afterscroll event.
0
 
LVL 3

Expert Comment

by:nnbbb09
Comment Utility

Assuming that the text that you want to set is present in the combobox items property you can use :

cmbFields.ItemIndex := cmbFields.Items.IndexOf('some text');

Jo
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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…
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…
This video discusses moving either the default database or any database to a new volume.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

743 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

16 Experts available now in Live!

Get 1:1 Help Now