02-11-2010 01:01 AM
Hi
i have a radio button with two input. at any time any one of the button is checked(selected).what i want is when i run the program, no button should be selected. how can do this programatically.it should look like below:
02-11-2010 01:50 AM - edited 02-11-2010 01:51 AM
Right click the border of the radio control. And select 'Allow No Selection', this extends the enum value of the control with a 'Allow No Selection' option and could break you allready existing code, be aware of this. To set the 'empty' value have a look at this code:
Ton
PS please post smaller picture.
02-11-2010 01:51 AM
02-11-2010 01:52 AM
There are two possible solutions:
1. Replace Radio buttons with booleans - so you will have two controls and both can be unchecked (some logic required for switch between both)
2. Add third Radio button - when user will select this, then both radio buttons above will be deselected automatically (IMHO from user interface point of view this solution preferred)
Andrey.
02-11-2010 01:53 AM
02-11-2010 03:06 AM
This has worked.but what i need is in the first frame the radio button is unchecked and in the next frame the user should be able to select the radio button.But in he solution provided by you, I'm not able to select the button once it is unchecked in the first frame.
02-11-2010 03:16 AM
TCPlomp wrote:Right click the border of the radio control. And select 'Allow No Selection', this extends the enum value of the control with a 'Allow No Selection' option and could break you already existing code, be aware of this. To set the 'empty' value have a look at this code:
![]()
Ah, thanks for point to this, I just forgot, that "No Selection" is allowed for Radio Buttons.
But I think, that end User will be frustrated a little bit with such logic. The main principle of Radio Buttons is that the only one can be selected. So, the user expectation is: if Radio Selection 1 will be selected, then Radio Selection 2 will be unselected automatically. Now Radio Selection 2 selected back and Radio Selection 1 unchecked. In case if "Allow No Selection" option will be enabled, then at the first, user will think "How can I do this?!" By click somewhere outside of control? No, he should click on selected button once again, then this button will be unselected and no buttons will be selected as shown in screenshot above. If somewhere in the same application another Radio Buttons group present, then User will be frustrated again: Is "No Selection" allowed for this group, or not? Click again on selected button - and button remain selected. So, solution with three buttons is probably not very elegant, but more simply for understanding from user's point of view.
But in general it depends from the application - how it used in context and which options behind of Radio Buttons.
Also refer to Radio Buttons Guidelines
Andrey.
02-11-2010 03:48 AM
Robin Hood wrote:This has worked.but what i need is in the first frame the radio button is unchecked and in the next frame the user should be able to select the radio button.But in he solution provided by you, I'm not able to select the button once it is unchecked in the first frame.
It means something like that:
Andrey.
02-11-2010 03:49 AM - edited 02-11-2010 03:51 AM
Hello Robin,
to understand the function of your code, you should run it with Code-Highlighting "On" (i.e. the little bulb should be yellow). Then you will see, with every loop the radio buttons are reset to "no selection. The correct codewould look like this (btw. the sequence is not necessary, it's just to show the little alteration I made to your code).

greets, Dave
P.S. a little bit slower than Andrej ![]()
02-11-2010 03:57 AM
daveTW wrote:
P.S. a little bit slower than Andrej
I'll give to you Kudo as comensation 😉 (and especially for explanation)
Andrey.