Solved

setting text property in dropdown list combo box

Posted on 2001-08-15
4
348 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
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…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

911 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

17 Experts available now in Live!

Get 1:1 Help Now