How to set a checkbox as checked

Started by scott_cd · 2017-02-10 12:57 UTC · 8 replies · SMF topic #2484

I am trying to set a checkbox and I am not sure of the correct syntax and I am using the following code:

(dcl-Control-SetProperty Tree_Survey/Form1/CheckBox7 1)

I understand that

0 = unchecked
1 = checked
2 = indeterminate

Using control property as below what is the PropertyApiName ?

(dcl-Control-SetProperty Tree_Survey/Form1/CheckBox7 PropertyApiName [as String] NewValue [as Varies])

Thanks in advance
Scott
(dcl-Control-SetValue Tree_Survey/Form1/CheckBox7 1)

best regards
marco
(dcl-Control-SetValue Tree_Survey/Form1/CheckBox7 1)

Hi Marco

Thanks forthat.

I have as you suggested changed it to set value but I still get the following error - see attached image?

Nil value not allowed ?

Attachments
The error message suggests that Tree_Survey/Form1/CheckBox7 control does not exist.
Would it help if I post my odcl file?
Sure.
my odcl file is attached.

Thanks for helping

Scott
Attachments
Initializing the dialog must be done in an event handler called OnInitialize (to quote the Help).
(defun c:Tree_Survey/Form1#OnInitialize (/)
  (dcl-Control-SetValue Tree_Survey/Form1/CheckBox7 1)
)
Yes that makes sense... ;D

Thanks again.