Solved

setting text property in dropdown list combo box

Posted on 2001-08-15
4
353 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
ID: 6389258
cmbFields.ItemIndex := 0;
0
 
LVL 4

Expert Comment

by:YodaMage
ID: 6389451
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
ID: 6389452
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
ID: 6389617

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

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

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…
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…

756 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