For this purpose, use the control
, please see http://msdn.microsoft.com/en-us/library/system.windows.forms.groupbox.aspx
During dynamic creation, add all mutually exclusive choices by
as children of the same instance of
or by setting value of the property
to the same instance of
Doing it dynamically is not harder than what you already done.
By the way, you could do exact same thing using
as a container for your radio buttons. The only reason to use an instance of the
is to give a common text label to the group (the property
). You can also use "&" prefix to one character of a label text (as you would do with usual labels (
class); then it will serve as a hot key for a whole group.