How to change TextBox font, text style in asp.net

TextBox font, text style
this example demonstrate you how can we set or change asp.net textbox web server control's font , text style. textbox has many built in property to change it's text style such as Font.Size, ForeColor, BackColor, Font.UnderLine, Font.Italic, Font.Bold etc. Using Font.Size help us to change the textbox text size large, medium, small etc. ForeColor change text color such as red, green, blue etc. Font.UnderLine apply for create underlined text. we can change textbox text style programmatically or input it within textbox tags.
TextBoxTextStyle.aspx

<%@ Page Language="C#" %>

<!DOCTYPE html>

<script runat="server">
    protected void Button1_Click(object sender, System.EventArgs e)
    {
        TextBox1.Font.Size = FontUnit.XLarge;
        TextBox1.ForeColor = System.Drawing.Color.Crimson;
        TextBox1.BackColor = System.Drawing.Color.Snow;
        TextBox1.BorderColor = System.Drawing.Color.HotPink;
        TextBox1.Font.Underline = true;
        TextBox1.Font.Italic = true;
    }
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>How to set, change TextBox font, text style</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <h2 style="color:Green">TextBox Example: Text Style</h2>
        <asp:Label 
             ID="Label1" 
             runat="server"
             Text="asp.net Control"
             >
        </asp:Label>
        <asp:TextBox 
             ID="TextBox1" 
             runat="server"
             Text="SqlDataSource"
             >
        </asp:TextBox>
        <br /><br />
        <asp:Button 
             ID="Button1" 
             runat="server" 
             ForeColor="DodgerBlue"
             Text="Change TextBox Style"
             OnClick="Button1_Click"
             Font-Bold="true"
             />
    </div>
    </form>
</body>
</html>
More asp.net examples