LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

how to disable a checkbox?

Hi folks!

There is a tree list in my application and all items of this list has a checkbox. This list is created dynamically. I want to disable/enable some checkboxes of the items of that list. How can I do it? I only know the number of the line that has the checkbox which I want do enable/disable.

Thank you!
0 Kudos
Message 1 of 2
(3,250 Views)
How about

SetTreeItemAttribute(..., ATTR_MARK_TYPE, VAL_MARK_NONE);

This will make the box for that item disappear entirely; there will be a gap where the box would have been so that item labels still line up properly.

If you want the checkbox to appear but be inoperable, you'll have to intercept and swallow (return 1) the EVENT_VAL_CHANGED (eventData1 == VAL_MARK_STATE_CHANGED) event in your callback function. There is not a way to dim a tree checkbox, however, so you'll have to find another way to let your user know that the tree item is inoperable.

Hope this helps.

Mert A.
National Instruments
0 Kudos
Message 2 of 2
(3,244 Views)