Author Topic: How to add items to combo list?  (Read 267 times)

neperin

  • Member
  • *
  • Posts: 4
How to add items to combo list?
« on: March 24, 2023, 01:33:45 PM »
Hello everybody.
I am a newbie, so the question might be rather simple.
How to add items to the combo box in modelless mode? I've search through properties but I couldn't find anything.

Fred Tomke

  • OpenDCL Technician
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2101
Re: How to add items to combo list?
« Reply #1 on: March 24, 2023, 02:16:07 PM »
Hi,

you can replace the complete list by calling AddList: http://www.opendcl.com/HelpFiles/index.php?page=Reference/Method/ComboBox/AddList.htm
you can add an item by calling AddString: http://www.opendcl.com/HelpFiles/index.php?page=Reference/Method/ComboBox/AddString.htm

The complete list of methods and properties you can see at http://www.opendcl.com/HelpFiles/index.php?page=Reference/Control/ComboBox.htm

I hope that helps.
With regards, Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

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

neperin

  • Member
  • *
  • Posts: 4
Re: How to add items to combo list?
« Reply #2 on: March 31, 2023, 06:59:35 AM »
Thanks for the reply.
However, I couldn't get the results I want. I really want to populate the combo box in the first place, when the program starts running.
But It is empty, unfortunately.

Here is my code snippet:
Code: [Select]
(defun c:qq ()
  (command "_OPENDCL")
  (dcl_project_load "modeless")
  (dcl_form_show modeless_mainForm)
  (dcl-Control-AddList bo_type (list "A" "B" "C"))
  (princ)
)

Fred Tomke

  • OpenDCL Technician
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2101
Re: How to add items to combo list?
« Reply #3 on: March 31, 2023, 11:27:34 AM »
Hello, have you already tried to put it into the OnInitialize event?
With regards, Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

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