Change Font Style (bold, Italic, bold italic) in C#
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/5607280/change-font-style-in-c">change font style in c#</a>  </p>
</blockquote>



<p>HI there I want to change the font style of a label to either bold, italic, etc.. using a dropdownlist in an aspx page. Please let me know what I'm doing wrong here, because nothing seem to work.</p>

<p>My Code:</p>

<pre><code>public void button_click(object sender, EventArgs e)
{
    var select= font1.SelectedItem.Value;
    if(select=="Bold")
    {
        // I have the following methods of doing this; None works for me.
        label1.Style["Font-Weight"]="bold";
        //I also tried this:
        label1.Font = new Font(label1.Font, FontStyle.Bold);
        //and this:
        this.label1.Font= new Font(this.label1.Font, FontStyle.Bold);
    }
}
</code></pre>

<p>When using .Font I get errors for invalid arguments, that the arguments for Font must be like this: Font(string, float). Also, keep in mind that the method of putting the actual size in the argument list is not what i want to do. Like this</p>

<pre><code>label1.Font=new Font("Arial", 16, FontStyle.Bold);
//I don't want to change the font family or sixe of the label's text
</code></pre>

<p>So thats what I have, I'm in a jam. Please enlighten me. Thanks</p>
