Board index » cppbuilder » Combo Box as Read-Only

Combo Box as Read-Only

I have made a pair of combo boxes into DropDownList boxes to prevent the
user from changing the contents of the boxes.  But now when I load the
information into the comboboxes, they do not appear as the top items.  Is
there a way to manipulate the index or load procedure to place my first
value as the top value in the list beside the down arrow?

Thank for any help
Weisen

 

Re:Combo Box as Read-Only


Hi, Weisen!

Usually, setting the ItemIndex does this. Are you setting that?

------
Mark Cashman (TeamB - C++ Builder), creator of The Temp{*word*203}Doorway at
http://www.temporaldoorway.com
- Original digital art, writing, music and more -
C++ Builder / JBuilder Tips and The C++ Builder Programmer's Webring
(Join us!)
http://www.temporaldoorway.com/programming/index.htm
------

Re:Combo Box as Read-Only


set the ItemIndex of your ComboBox to zero, then the first item is visible.

Henrik

Weisen <b...@msgerber.com> schrieb in im Newsbeitrag: 3b4cbeb3$1_1@dnews...

Quote
> I have made a pair of combo boxes into DropDownList boxes to prevent the
> user from changing the contents of the boxes.  But now when I load the
> information into the comboboxes, they do not appear as the top items.  Is
> there a way to manipulate the index or load procedure to place my first
> value as the top value in the list beside the down arrow?

> Thank for any help
> Weisen

Re:Combo Box as Read-Only


Yeah, I tried that, but nothing appears as the "default" text

The search continues, Thanks for your help
Weisen

Re:Combo Box as Read-Only


You could always do an IndexOf()  that will return the Index in the combobox
of the element you want selected.  I've had trouble setting the ItemIndex to
0 then when when I want to save the value from the combo even if the user
changed the value the ItemIndex stayed the same ...  (might be an other
topic though) ...

Good luck !!
CheGueVerra

Quote
Weisen <b...@msgerber.com> wrote in message news:3b4d99ee$1_1@dnews...
> Yeah, I tried that, but nothing appears as the "default" text

> The search continues, Thanks for your help
> Weisen

Other Threads