OpenDCL Forums

OpenDCL => Studio/Dialog Editor => Topic started by: neperin on March 24, 2023, 01:33:45 PM

Title: How to add items to combo list?
Post by: neperin 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.
Title: Re: How to add items to combo list?
Post by: Fred Tomke 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
Title: Re: How to add items to combo list?
Post by: neperin 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:

(defun c:qq ()
  (command "_OPENDCL")
  (dcl_project_load "modeless")
  (dcl_form_show modeless_mainForm)
  (dcl-Control-AddList bo_type (list "A" "B" "C"))
  (princ)
)
Title: Re: How to add items to combo list?
Post by: Fred Tomke on March 31, 2023, 11:27:34 AM
Hello, have you already tried to put it into the OnInitialize event?
With regards, Fred