Radiobutton Class - Need to groub Radiobuttons into group
<p>I have created my own radio button class – namely MyRadioButton, as the built in .NET class did not enlarge effectively. (using this for touch screen)</p>

<p>MyRadioButton Class works well, expect for an issue which I do not know How to resolve - When I have multiple MyRdaioButtons on a form, I can select all of them.... They somehow do not work as they should where when one selects one the others are automatically be deselected.</p>

<p>My code is as follows:</p>

<pre><code> public class MyRadioButton : Control
{
    public MyRadioButton()
    {

    }
    private string textTowrite;
    private bool checkStatus;
    private int width;
    private int height;
    public event EventHandler CheckedChanged;
    public delegate void MyHandler1(object sender, EventArgs e);

    protected override void OnClick(EventArgs e)
    {
        base.OnClick(e);
        if (Checked)
            Checked = false;
        else
            Checked = true;
        Invalidate(true);
    }

    protected override void OnPaint(PaintEventArgs e)
    {
        base.OnPaint(e);
        ButtonState btnstate;
        Rectangle rRadioButton;

        if (checkStatus)
        {
            btnstate = ButtonState.Checked;
        }
        else
            btnstate = ButtonState.Normal;

        rRadioButton = new Rectangle(0, 0, RBWidth, RBHeight);
        FontFamily ft = new FontFamily("Tahoma");
        Font fnt_radio = new Font(ft, (int)(18), FontStyle.Bold);

        ControlPaint.DrawRadioButton(e.Graphics, -2, 10, rRadioButton.Width,
            rRadioButton.Height, btnstate);
        //RadioButton's text left justified &amp; centered vertically
        e.Graphics.DrawString(textTowrite, fnt_radio, new SolidBrush(Color.Black), rRadioButton.Right + 1, 16);

    }

    protected virtual void OnCheckedChanged(EventArgs e)
    {
        if (CheckedChanged != null)
        {
            CheckedChanged(this, e);
        }

    }

    public override string Text
    {
        get { return textTowrite; }
        set { textTowrite = value; }
    }

    public bool Checked
    {
        get { return checkStatus; }
        set
        {
            checkStatus = value;
            OnCheckedChanged(EventArgs.Empty);
        }
    }

    public int RBWidth
    {
        get
        {
            if (width == 0)
            {
                width = 40;
            }
            return width;
        }
        set
        {
            if (width != value)
            {
                width = value;
                Invalidate();
            }
        }
    }

    public int RBHeight
    {
        get
        {
            if (height == 0)
            {
                height = 40;
            }
            return height;
        }
        set
        {
            if (height != value)
            {
                height = value;
                Invalidate();
            }
        }

    }

}
</code></pre>

<p>If someone could provide me with a solution it would be greatly appreciated, as I am pulling out my hair</p>

<p>Thanks</p>

<p>Jens</p>
