Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: Windows form Radbutton
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 20:41pm
Edited 18-Feb-13 20:43pm
Sergey Alexandrovich Kryukov at 19-Feb-13 1:52am
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 at 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;-)
Sergey Alexandrovich Kryukov at 19-Feb-13 2:16am
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 at 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 at 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 at 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 at 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
0 Sergey Alexandrovich Kryukov 434
1 OriginalGriff 385
2 CHill60 230
3 CPallini 220
4 Abhinav S 200
0 Sascha Lefévre 75
1 OriginalGriff 70
2 F-ES Sitecore 55
3 Peter Leow 50
4 Dave Kreskowiak 40

Advertise | Privacy | Mobile
Web01 | 2.8.150327.1 | Last Updated 19 Feb 2013
Copyright © CodeProject, 1999-2015
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