How to change Border width of checkbox contol programmatically in ASP.Net with C#.
STEP 1 – Design the ASP.Net web page with One CheckBox 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=”https://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: 496px”>
<tr>
<td colspan=”1″ style=”width: 274px; height: 24px”>
<strong><span style=”font-size: 14pt; color: #6600cc; font-family: Arial”>Change CheckBox
Border width Programmatically </span></strong></td>
</tr>
<tr>
<td style=”width: 274px; height: 8px;”>
</td>
</tr>
<tr>
<td style=”width: 274px; height: 22px; text-align: center;”>
<asp:CheckBox ID=”CheckBox1″ runat=”server” Text=”CheckBox Font Style” Font-Bold=”True” /></td>
</tr>
<tr>
<td style=”width: 274px”><asp:Button ID=”Button1″ runat=”server” OnClick=”Button1_Click” Text=”Border 3″ Font-Bold=”True” />
<asp:Button ID=”Button2″ runat=”server” OnClick=”Button2_Click” Text=”Border 7″ Font-Bold=”True” /></td>
</tr>
<tr>
<td style=”width: 274px; text-align: center”></td>
</tr>
</table>
</td>
</tr>
<tr>
</tr>
</table>
The ASP.Net Checkbox Example output is :
STEP 2 – write below code at asp.net code page:
protected void Button1_Click(object sender, EventArgs e)
{
CheckBox1.BorderWidth = 3;
}protected void Button2_Click(object sender, EventArgs e)
{
CheckBox1.BorderWidth = 7;
}
The ASP.Net Checkbox Example output is :
The ASP.Net Checkbox Example output is :
I hope this Checkbox control change border width ASP.Net Example will help you…