Author Topic: Combo box styles  (Read 5295 times)

Jim Short

  • Full Member
  • ***
  • Posts: 243
    • Tahl Inc
Combo box styles
« on: June 17, 2009, 07:56:29 PM »
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

  • Administrator
  • Hero Member
  • *****
  • Posts: 3086
    • Outside The Box
Re: Combo box styles
« Reply #1 on: June 17, 2009, 08:55:57 PM »
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

  • Full Member
  • ***
  • Posts: 243
    • Tahl Inc
Re: Combo box styles
« Reply #2 on: June 18, 2009, 05:39:20 AM »
Thanks Owen, that works.

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

Fred Tomke

  • OpenDCL Technician
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2085
  • [ Mr. Bad Guy ]
    • Kommunale Entwicklungsplanung auf digitaler Basis - digital landscape and urban design
Re: Combo box styles
« Reply #3 on: June 18, 2009, 05:50:00 AM »
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

  • Administrator
  • Hero Member
  • *****
  • Posts: 3086
    • Outside The Box
Re: Combo box styles
« Reply #4 on: June 18, 2009, 07:38:23 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

  • Member
  • *
  • Posts: 7
Re: Combo box styles
« Reply #5 on: December 19, 2022, 09:43:49 AM »
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

  • OpenDCL Technician
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2085
  • [ Mr. Bad Guy ]
    • Kommunale Entwicklungsplanung auf digitaler Basis - digital landscape and urban design
Re: Combo box styles
« Reply #6 on: December 19, 2022, 10:18:03 AM »
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

  • Member
  • *
  • Posts: 7
Re: Combo box styles
« Reply #7 on: December 19, 2022, 11:35:52 AM »
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