LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Changing control style on the fly ?

Hello all,

I tried to do this to change the style of a control on the fly:

SetCtrlAttribute(Pnl, Ctrl, ATTR_CTRL_STYLE,
B ? CTRL_SQUARE_RADIO_BUTTON : CTRL_CHECK_BOX);

But I get a runtime error "That attribute is not a settable attribute"
How can I do this simply besides the obvious NewCtrl/DiscardCtrl with all
the copies of attributes that go with it ?
--
Guillaume Dargaud
http://www.gdargaud.net/


0 Kudos
Message 1 of 3
(3,087 Views)

How about having two controls drawn in the same place on the panel and connected to the same callback. One with the check box style and one with the radio button style. Then just set/clear a single attribute for both controls (ATTR_VISIBLE) when you want to swap from one to the other.

 

JR

0 Kudos
Message 2 of 3
(3,083 Views)
> How about having two controls drawn in the same place on the panel and
> connected
> to the same callback. One with the check box style and one with the radio
> button
> style. Then just set/clear a single attribute for both controls
> (ATTR_VISIBLE)
>  when you want to swap from one to the other. JR

Well, I did it this way, I'm just suprised that since you can do it easily
in the UIR with the F11 keypress, that you can't do it in code...
--
Guillaume Dargaud
http://www.gdargaud.net/


0 Kudos
Message 3 of 3
(3,038 Views)