OpenDCL Forums

OpenDCL => Runtime/AutoLISP => Topic started by: jmcgrew on February 20, 2012, 10:52:38 AM

Title: Checkbox Visibility
Post by: jmcgrew on February 20, 2012, 10:52:38 AM
Ok I am very new at this so sorry in advance. What I am trying to do is I have a dropdown that list different locations and I have two check box's that I want there Visibility to change per what is selected in my dropdown (ex. dropdown set to "General" both checkbox's are not visible, dropdown set to "Oklahoma" checkbox1 is visible but not checkbox2)

Thanks for any help
Title: Re: Checkbox Visibility
Post by: Fred Tomke on February 20, 2012, 01:21:39 PM
Hi and welcome,

without knowing your code I can give you this sample:

Code (autolisp) Select

  (defun c:myproject_myform_mycombo_OnSelChanged (intRow strItem)
    ;; intRow 0 = General
    ;; intRow 1 = Oklahoma
    ;; intRow 2 = Berlin
    (dcl_control_setvisible myproject_myform_mycheckbox1 (= intRow 1))
    (dcl_control_setvisible myproject_myform_mycheckbox2 (= intRow 2))
  ); c:myproject_myform_mycombo_OnSelChanged


Regards, Fred
Title: Re: Checkbox Visibility
Post by: jmcgrew on February 20, 2012, 02:10:35 PM
Fred,

Here is my code and odcl, its pretty rough but working on it.
Title: Re: Checkbox Visibility
Post by: Fred Tomke on February 21, 2012, 04:50:16 AM
Hi,

as I mentioned you should catch the event OnSelChanged, but not OnDropDown. OnDropDown is normally used if the list should be filled right before the user is going to open the dropdownlist. I recommend you to change your code the way I've shown in my sample.

Regards, Fred
Title: Re: Checkbox Visibility
Post by: jmcgrew on February 21, 2012, 07:01:57 AM
Fred,

That worked perfect thanks for the help!

Jutin