Checkbox Visibility

Started by jmcgrew, February 20, 2012, 10:52:38 AM

Previous topic - Next topic

jmcgrew

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

Fred Tomke

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
Fred Tomke
Dipl.-Ing. (FH) Landespflege

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

jmcgrew

Fred,

Here is my code and odcl, its pretty rough but working on it.

Fred Tomke

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
Fred Tomke
Dipl.-Ing. (FH) Landespflege

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

jmcgrew

Fred,

That worked perfect thanks for the help!

Jutin