Click here to Skip to main content
13,090,930 members (47,794 online)
Rate this:
Please Sign up or sign in to vote.

I want a set of radio buttons in a form so as to provide the liberty to select more than one radio button. I know we can achieve this using containers like GroupBox and Panel. But I have been asked to do this without using those containers. Its basically seem to provide the functionality of Check Box to Radio Buttons.

Thanks in Advance.
Posted 18-Feb-13 19:41pm
Updated 18-Feb-13 19:43pm
Why? Why?!
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Never attempt to do it. First of all, it will enormously confuse the users.

(By the way, I just found that it's technically quite possible. Just a funny exercise in logical thinking. Anyone who knows how radio buttons work, not even on programming level, should be able to find out the trick. This is a hint. But please, do yourself a big favor, don't even thing about doing it for a real application.)

Good luck,
ankitjha23 19-Feb-13 2:05am
Actually I am quite new to windows programming and C#. It would be very helpful if you could please elaborate your hint;-)
Are you going to use Radio Buttons as Check Boxes? Don't do it.
The hint is only for a funny exercise, and it does not really require development experience. If I disclose it, what's the fun?
Please understand, no practical use of it, and we don't need abuse, do we? :-)
ankitjha23 19-Feb-13 2:51am
NO not at all. Just for fun my mentor asked to do. I'll get an answer and get back to forum.By the way Thanks for your immediate response.
Sergey Alexandrovich Kryukov 19-Feb-13 11:40am
OK, but didn't you get the idea. Remember what happens if you, as a user, click on a radio button. A previously checked one is unchecked, and this is the problem, right? And what if you already have two different radio buttons checked? This is possible, right? You could see in in many applications. Why it was possible? It's easy...
ankitjha23 20-Feb-13 23:50pm
But I don't want tom make Checked=true. The privilege of checking is to be given to the user.
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

Hi.if you working with WPF you can use ControlTemplate Like this:
<RadioButton Content="MyRadioButton" Height="15">
                <ControlTemplate TargetType="{x:Type RadioButton}">
                    <CheckBox Content="{TemplateBinding Content}"/>

i think it's not logical because each control has own domain usage.but choose yourself.
Good Luck
ankitjha23 19-Feb-13 3:32am
I am working with windows form. But any ways, I appreciate your response.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web03 | 2.8.170813.1 | Last Updated 19 Feb 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100