Click here to Skip to main content
15,880,891 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am creating a windows form in C# with dynamic controls (Ex:- Textboxes, Labels, Buttons...). I want to add set of radio buttons in to the form and group them. But I don't like to use panels or group boxes for grouping them. Is there a way to do that? Please advice.

Thanks for helping,
Kushan Randima.
Software Engineer
Posted
Updated 26-Oct-14 18:38pm
v2
Comments
Pikoh 29-Jul-14 6:46am    
Well,i don't understand why you don´t like to group things that should be grouped by definition. That said,what is your problem? Radio buttons will behave ok at a form level i suppose.
EDIT:
And BTW,panels are invisible by default,what's the deal using them?

I think that simplest way to do this is to use Control.Tag property. Tag is property of Object type, so you can put there anything you want. But doing this, you must subscribe to dynamically created RadioButton's OnClick event to handle selection within groups.

And link:
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.tag%28v=vs.110%29.aspx[^]

I hope it help you.
 
Share this answer
 
v2
We can not group specific radio buttons without having groupbox or panel any other container in windows forms (c#)
 
Share this answer
 
you can use table control on windows form
 
Share this answer
 
v2
Windows Form Provide By Default Grouping In Group Box
 
Share this answer
 
v2

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900