NI Home
Cart Cart | Help
Hello Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI
You are here: 
NI Home > NI Developer Zone > NI Discussion Forums


Reply
Member
Waley
Posts: 5
0 Kudos

Is it possible to have mutually exclusive dialog radio buttons?

Is it possible to create a set of mutually exclusive dialog radio buttons in such a way that only one radio button per set can be selected at a time? Can LabVIEW detect which buttons are pressed to ensure only one is set to true before the program runs?
Member
FightOnSCTrojan
Posts: 168
0 Kudos

Re: Is it possible to have mutually exclusive dialog radio buttons?

I would create a couple events/or case, in which if one radio button is pressed, the rest are disabled (or even disabled and grayed). This way you will be able to ensure that only one button is pressed at the time!


USCTrojan
Trusted Enthusiast
mikeporter
Posts: 3,832

Re: Is it possible to have mutually exclusive dialog radio buttons?

The proper way of doing this is, believe it or not, with a customized slide control. It looks like radio buttons and outputs the number of the option selected.

Attached is a VI showing two I put together. To use them use the text control at the bottom of the control to set the name of the buttons, or add new ones by adding items to the list.

Once you have the items configured, right click on one of the buttons and select Visible>>Text Display to hide the text display and you're read ro rock and roll.

Mike...
Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

mlportersr@gmail.com

"Safe? Who said anything about 'safe'? 'Course he's not safe - but he is good..."
Active Participant
Enrique
Posts: 852
0 Kudos

Re: Is it possible to have mutually exclusive dialog radio buttons?

This was way too cool...
www.vartortech.com
Active Participant
Alberto
Posts: 401
0 Kudos

Re: Is it possible to have mutually exclusive dialog radio buttons?

Great idea Mike!!!
Alberto
Member
Alexander J.
Posts: 104
0 Kudos

Re: Is it possible to have mutually exclusive dialog radio buttons?

This is very good.
Trusted Enthusiast
mikeporter
Posts: 3,832
0 Kudos

Re: Is it possible to have mutually exclusive dialog radio buttons?

Only wish I could take credit for it, but it came about at least two or three major revs ago...

Mike...
Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

mlportersr@gmail.com

"Safe? Who said anything about 'safe'? 'Course he's not safe - but he is good..."
Member
FightOnSCTrojan
Posts: 168
0 Kudos

Re: Is it possible to have mutually exclusive dialog radio buttons?

Thanks Mike for the great way of doing things!
I wonder how did you customize the slide control to make it look that the VI that you've attached with your answer?

FightonSCTrojan
Active Participant
JeanPierre
Posts: 1,056
0 Kudos

Re: Is it possible to have mutually exclusive dialog radio buttons?

Yeah. I've always wondered why this radio button technique hasn't made its way to the standard control palette yet. IIRC the codeless radio button was first published by Stepan Riha in LTR long ago.


LabVIEW, C'est LabVIEW

Trusted Enthusiast
mikeporter
Posts: 3,832
0 Kudos

Re: Is it possible to have mutually exclusive dialog radio buttons?

Basically, when you go into edit mode you can copy and paste graphics to be used for different display components. I made the marker indexes look like unselected booleans, and the slider look like a selected boolean.

Mike...
Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

mlportersr@gmail.com

"Safe? Who said anything about 'safe'? 'Course he's not safe - but he is good..."
By using this web site, you accept the Terms of Use for this web site. Please read these Terms of Use carefully before using any part of this site. Please go here for information on ni.com's copyright infringement policy.
My Profile | Privacy | Legal | Contact NI © 2011 National Instruments Corporation. All rights reserved.    |    E-Mail this Page E-Mail this Page