Change CheckBox Font Size Programmatically in ASP.Net C#

In this ASP.Net Checkbox control Example we learn to change the Font Size of CheckBox control programmatically in ASP.Net with C#.

STEP 1 – Design the ASP.Net web page with one Checkbox control, one Label Control along with the two Button Control:

<table border=”1″ bordercolor=”#000000″ style=”z-index: 100; left: 272px; position: absolute;
top: 72px”>
<tr>
<td colspan=”3″ style=”width: 582px; height: 100px;”>
<asp:Image ID=”Image1″ runat=”server” ImageUrl=”http://meeraacademy.com/wp-content/themes/elemin/uploads/logo/meeralogo.gif” /></td>
</tr>
<tr>
<td colspan=”3″ rowspan=”2″ style=”width: 582px; height: 21px; text-align: center”>
<table style=”width: 464px”>
<tr>
<td colspan=”1″ style=”width: 257px; height: 24px”>
<strong><span style=”font-size: 14pt; color: #6600cc; font-family: Arial”>Change CheckBox Font Size Programmatically</span></strong></td>
</tr>
<tr>
<td style=”width: 257px; height: 24px;”>
&nbsp;
</td>
</tr>
<tr>
<td style=”width: 257px; height: 22px; text-align: center;”>
&nbsp;<asp:CheckBox ID=”CheckBox1″ runat=”server” Text=”CheckBox Font Size” Font-Bold=”True” /></td>
</tr>
<tr>
<td style=”width: 257px”><asp:Button ID=”Button1″ runat=”server” OnClick=”Button1_Click” Text=”Large Font” Font-Bold=”True” />&nbsp;
<asp:Button ID=”Button2″ runat=”server” OnClick=”Button2_Click” Text=”XXLarge Font” Font-Bold=”True” Width=”104px” /></td>
</tr>
<tr>
<td style=”width: 257px; text-align: center”>
<asp:Label ID=”lblanswer” runat=”server” Font-Bold=”True” ForeColor=”Maroon”></asp:Label></td>
</tr>
</table>
</td>
</tr>
<tr>
</tr>
</table>

The ASP.Net Checkbox Example output is :

Change Text Font Size of CheckBox control in ASP.Net with C#

Change Text Font Size of CheckBox control in ASP.Net with C#

STEP 2 – write below code at ASP.Net code page:

protected void Button1_Click(object sender, EventArgs e)
{
CheckBox1.Font.Size = FontUnit.Large;
lblanswer.Text = “Font Size = Large”;
}
protected void Button2_Click(object sender, EventArgs e)
{
CheckBox1.Font.Size = FontUnit.XXLarge;
lblanswer.Text = “Font Size = XXLarge”;
}

The ASP.Net Checkbox Example output is :

Change Text Font Size of CheckBox control in ASP.Net with C#

Change Text Font Size of CheckBox control in ASP.Net with C#

The ASP.Net Checkbox Example output is :

Change Text Font Size of CheckBox control in ASP.Net with C#

Change Text Font Size of CheckBox control in ASP.Net with C#

 

I hope this checkbox control ASP.Net Example will help you……..

Leave a Reply

Your email address will not be published. Required fields are marked *

3 + 2 =


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">