How to make a controls compliant for winform and webform?
<p>In my application I have methods which returns a control (checkbox, radiobutton, textbox) but I want to use the same class for my webform and winform. How can I achieve this? I was thinking about an interface, but I don't know how to implement this.</p>

<p>In my code I have the following methods:</p>

<pre><code>public TextBox GenerateTextfield(AnswerPossibility answerPossibility)
{
    TextBox textBox = new TextBox();
    textBox.Tag = answerPossibility.Tag;

    return textBox;
}

public Collection&lt;ButtonBase&gt; GenerateMultipleChoice(Collection&lt;AnswerPossibility&gt; answers)
{
    Collection&lt;ButtonBase&gt; checks = new Collection&lt;ButtonBase&gt;();

    foreach (AnswerPossibility a in answers)
    {
        CheckBox chk = new CheckBox();
        chk.Text = a.Text;
        chk.Name = "chk" + a.Id.ToString();
        chk.Tag = a.Tag;

        checks.Add(chk);
    }

    return checks;
}
</code></pre>

<p>How can I make this so, that I can use this methods in a win form as well in a web form?</p>
