Combo box styles

Started by Jim Short, June 17, 2009, 07:56:29 PM

Previous topic - Next topic

Jim Short

How do I keep the text displayed in the edit box from being edited by the user?
What are the differences between styles 0, 1, and 2?
Is there a restriction on when this property can be changed?

Thanks,
Jim
Jim Short

owenwengerd

Right-click on a combo box in the editor and select Properties, then check out the "Combo Box Styles" tab. This should help answer your question.

Jim Short

Thanks Owen, that works.

But does the following also work?
(dcl_Control_SetComboBoxStyle Onset_Outline_cbTabMachine NewValue [as Integer])
Jim Short

Fred Tomke

Hm, that does not work for me in a palette. But I'm not sure if it is a design time property...
Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

owenwengerd

Quote from: Jim Short on June 18, 2009, 05:39:20 AM
But does the following also work?
(dcl_Control_SetComboBoxStyle Onset_Outline_cbTabMachine NewValue [as Integer])

No, the combo type cannot currently be changed at runtime.  Runtime changes should be possible in the future, but it has to be done by destroying the old combo and creating a new one in its place.

JBerns

Since my question is related to this old topic, I thought I would reply to this post.
If I should start a new post due to age, I can.

I am using Open DCL, version 9.2.0.3.

I have created a ComboBox that should only allow the user to select, not edit.

However, using Style = 2 - Drop Down, the control appears disabled (gray).
If I choose Style 0 or 1, the control appears enabled.
Please see attachment.

How can I make the control appear enabled, but allow selection only, no editing?

Thank you for your time and attention. I look forward to your replies.

Regards,
Jerry

Fred Tomke

Hello, Jerry, it is neccessary to know the differences between theses styles: Combobox-style means that you can either input text or select a list item. DropDown-style means, that you cannot input any text - you can only select an item from the list. To do so, it is neccessary to fill the list right before. The gray background of a drop-down-styled control underlines that the user cannot input any text. I hope, this makes it a little bit more clear.
With regards, Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

JBerns

Thank you for the quick reply. Fred.

This is my first time using a ComboBox as a select only. I was not expecting the control to change color to gray. It sure looked disabled.

I compared this OpenDCL style to a Visual Basic ComboBox control and it too changes to gray when its DropDownStyle = DropDownList (select only, no edit).

I will inform my users. Thanks again.

Regards,
Jerry

TCNTRM

I know its an old topic but related question or maybe more of a suggestion concerning combo box, but is it possible to have a 0 - Combo box without the possibility of editing (writing new text), so just choosing stuff that is in the list. I like the white background color of it, 2 - Drop down is always grey, cant be changed to other color am I right?

And also second thing, like for example if I choose style 13 - Layers, the combo box selection width is changed (its larger) when on drop down if there are layer names longer than box width. If you understand my point. I'd like to have the same for 0 or 2 style, because often I have options in list that are very long, many string characters, and on drop down 0 or 2 style the selection box stays the same width as the combo box and you can't see complete list string.

I'm pretty sure these thing can't be done now, but maybe a suggestion for the future release?