LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

regarding Radio buttons

Hello,
   how do i group radiobuttons, so as to provide mutual exclusion property....
 
thanku
0 Kudos
Message 1 of 4
(3,660 Views)

Hellow,

you can add a radio group (Custom controls->Toolslib controls) instead of seperate radio buttons.

Hop this helps.

0 Kudos
Message 2 of 4
(3,653 Views)

One other way you could do this:

  • Set the default state to all radio buttons to OFF, except for one of them
  • Have all radio buttons trigger the same callback function
  • Within this callback function, have the EVENT_COMMIT section of code set ALL radio buttons to OFF
  • Using the control parameter passed to the callback, identify which radio button was actually clicked
  • Use SetCtrlVal() to re-set the desired radio button back to ON

This can be made more elegant by using an array to store the control identifiers:

  • int radio [] = {PANEL_RADIO1, PANEL_RADIO2, PANEL_RADIO3};

and then do the above processing within a simple loop.

JR

0 Kudos
Message 3 of 4
(3,647 Views)

thanku.....

Kimaya

0 Kudos
Message 4 of 4
(3,629 Views)