Category Archives: CheckBox Control Example

How to Visible / Hide Checkbox Programmatically in ASP.Net

In this ASP.Net tutorials we will learn to change the Checkbox mode from Visible to Hide programmatically in ASP.Net C# with an Example.

STEP 1 – Design the ASP.Net web form with One Checkbox control, one Label control and 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: 464px”>
<tr>
<td colspan=”1″ style=”width: 257px; height: 24px”>
<strong><span style=”font-size: 14pt; color: #6600cc; font-family: Arial”>Hide / Visible
CheckBox 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 Visible / Hide” Font-Bold=”True” /></td>
</tr>
<tr>
<td style=”width: 257px”><asp:Button ID=”btnVisible” runat=”server” OnClick=”btnVisible_Click” Text=”Visible” Font-Bold=”True” />&nbsp;
<asp:Button ID=”btnHide” runat=”server” OnClick=”btnHide_Click” Text=”Hide” Font-Bold=”True” Width=”64px” /></td>
</tr>
<tr>
<td style=”width: 257px; text-align: center”>
<asp:Label ID=”lblanswer” runat=”server”></asp:Label></td>
</tr>
</table>
</td>
</tr>
<tr>
</tr>
</table>

The ASP.Net Checkbox Control Example output is :

Visible and Hide Checkbox control in ASP.Net with C#

Visible and Hide Checkbox control in ASP.Net with C#

STEP 2 – write below code at code behind file on Button Click Event of ASP.Net web page:

protected void btnVisible_Click(object sender, EventArgs e)
{
CheckBox1.Visible = true;
lblanswer.Text = “CheckBox is Visible”;
}
protected void btnHide_Click(object sender, EventArgs e)
{
CheckBox1.Visible = false;
lblanswer.Text = “CheckBox is Hide”;
}

The ASP.Net Checkbox Control Example output is :

Visible and Hide Checkbox control in ASP.Net with C#

Visible and Hide Checkbox control in ASP.Net with C#

The ASP.Net Checkbox Control Example output is :

Visible and Hide Checkbox control in ASP.Net with C#

Visible and Hide Checkbox control in ASP.Net with C#

I hope this ASP.Net Checkbox control example of Visible / Hide will help you….

How to change CheckBox Text Align in ASP.Net C#

In this ASP.Net tutorials we will learn to change the Checkbox text align programmatically in ASP.Net C# with an Example.

STEP 1 – Design the ASP.Net web page with one CheckBox control along with Two Button Control like :

<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
Text Align Programmatically</span></strong></td>
</tr>
<tr>
<td style=”width: 274px; height: 8px;”>
&nbsp;
</td>
</tr>
<tr>
<td style=”width: 274px; height: 22px; text-align: center;”>
&nbsp;<asp:CheckBox ID=”CheckBox1″ runat=”server” Text=”CheckBox Text Align” Font-Bold=”True” />&nbsp;</td>
</tr>
<tr>
<td style=”width: 274px”><asp:Button ID=”Button1″ runat=”server” OnClick=”Button1_Click” Text=”Left Align Text” Font-Bold=”True” />&nbsp;
<asp:Button ID=”Button2″ runat=”server” OnClick=”Button2_Click” Text=”Right Align Text” 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 Control Example output is :

Change text align of checkbox control in ASP.Net with C#

Change text align of checkbox control in ASP.Net with C#

STEP 2 – write below code at code behind page of ASP.Net web application.

protected void Button1_Click(object sender, EventArgs e)
{
CheckBox1.TextAlign = TextAlign.Left;
}

protected void Button2_Click(object sender, EventArgs e)
{
CheckBox1.TextAlign = TextAlign.Right;
}

The ASP.Net Checkbox Control Example output is :

Change text align of checkbox control in ASP.Net with C#

Change text align of checkbox control in ASP.Net with C#

The ASP.Net Checkbox Control Example output is :

Change text align of checkbox control in ASP.Net with C#

Change text align of checkbox control in ASP.Net with C#

– Hope this ASP.Net Checkbox text align example will help you …

How to change CheckBox Text Programmatically in ASP.Net

In this ASP.Net tutorials we will learn to change the Checkbox text programmatically in ASP.Net C# with an Example.

STEP 1 – Design the ASP.Net web page with One CheckBox control, One Button Control and One Label 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: 464px”>
<tr>
<td colspan=”1″ style=”width: 257px; height: 24px; text-align: center;”>
<strong><span style=”font-size: 14pt; color: #6600cc; font-family: Arial”>Change CheckBox Text 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 HI” Font-Bold=”True” /></td>
</tr>
<tr>
<td style=”width: 257px; height: 26px;”><asp:Button ID=”btnchangetext” runat=”server” OnClick=”btnchangetext_Click” Text=”Chage Text” Font-Bold=”True” /></td>
</tr>
<tr>
<td style=”width: 257px; text-align: center”>
<asp:Label ID=”lblanswer” runat=”server”></asp:Label></td>
</tr>
</table>
</td>
</tr>
<tr>
</tr>
</table>

The ASP.Net Checkbox Example output is :

Change Text of CheckBox Control in ASP.Net with C#

Change Text of CheckBox Control in ASP.Net with C#

STEP 2 – write below code at ASP.Net code page on Button Click Event:

protected void btnchangetext_Click(object sender, EventArgs e)
{
CheckBox1.Text = “HELLO”;
lblanswer.Text=”CheckBox Text Changed”;
}

The ASP.Net Checkbox Control Example output is :

Change Text of CheckBox Control in ASP.Net with C#

Change Text of CheckBox Control in ASP.Net with C#

– I hope this ASP.Net tutorials of Change Text of CheckBox Control will help you…..

 

How to change Checbox text style in ASP.Net C#

In this ASP.Net tutorial we will learn to change the Checkbox text style programmatically in ASP.Net with C#.

STEP 1 – Design ASP.Net web form with one CheckBox control along with 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: 464px”>
<tr>
<td colspan=”1″ style=”width: 257px; height: 24px”>
<strong><span style=”font-size: 14pt; color: #6600cc; font-family: Arial”>Change CheckBox Font Style Programmatically</span></strong></td>
</tr>
<tr>
<td style=”width: 257px; height: 14px;”>
&nbsp;
</td>
</tr>
<tr>
<td style=”width: 257px; height: 22px; text-align: center;”>
&nbsp;<asp:CheckBox ID=”CheckBox1″ runat=”server” Text=”CheckBox Font Style” Font-Bold=”True” /></td>
</tr>
<tr>
<td style=”width: 257px”><asp:Button ID=”Button1″ runat=”server” OnClick=”Button1_Click” Text=”Change Style” Font-Bold=”True” /><asp:Button ID=”Button2″ runat=”server” OnClick=”Button2_Click” Text=”Original Style” Font-Bold=”True” /></td>
</tr>
<tr>
<td style=”width: 257px; text-align: center”>
</td>
</tr>
</table>
</td>
</tr>
<tr>
</tr>
</table>

The ASP.Net Checkbox Example output is :

Change Text Style of CheckBox in ASP.Net with C#

Change Text Style of CheckBox in ASP.Net with C#

STEP 2 – write the below code on code file of ASP.Net application :

    protected void Button1_Click(object sender, EventArgs e)
{
CheckBox1.Font.Italic = true;
CheckBox1.Font.Underline = true;
CheckBox1.Font.Bold = false;
}

protected void Button2_Click(object sender, EventArgs e)
{
CheckBox1.Font.Italic = false;
CheckBox1.Font.Underline = false;
CheckBox1.Font.Bold = true;
}

The ASP.Net Checkbox Example output is :

Change Text Style of CheckBox in ASP.Net with C#

Change Text Style of CheckBox in ASP.Net with C#

The ASP.Net Checkbox Example output is :

Change Text Style of CheckBox in ASP.Net with C#

Change Text Style of CheckBox in ASP.Net with C#

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

How to change checkbox check status by change another checkbox status

Here, we are going to learn in this ASP.Net Checkbox Example, How to change the check status of checkbox by change the another checkbox check status programmatically in ASP.Net with C#.

STEP 1 – Design the ASP.Net web page with Two CheckBox 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: 464px”>
<tr>
<td colspan=”1″ style=”width: 257px; height: 24px”>
<strong><span style=”font-size: 14pt; color: #6600cc; font-family: Arial”>Change CheckBox
Status by another CheckBox</span></strong></td>
</tr>
<tr>
<td style=”width: 257px; height: 24px;”><asp:CheckBox ID=”CheckBox1″ runat=”server” Text=”CheckBox1″ Font-Bold=”True” AutoPostBack=”True” OnCheckedChanged=”CheckBox1_CheckedChanged” />&nbsp;
</td>
</tr>
<tr>
<td style=”width: 257px; height: 22px; text-align: center;”>
<asp:CheckBox ID=”CheckBox2″ runat=”server” Text=”CheckBox2″ Font-Bold=”True” /></td>
</tr>
<tr>
<td style=”width: 257px; text-align: center”>
</td>
</tr>
</table>
</td>
</tr>
<tr>
</tr>
</table>

The ASP.Net Checkbox Example output is :

Change check status of CheckBox control in ASP.Net with C#

Change check status of CheckBox control in ASP.Net with C#

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

    protected void CheckBox1_CheckedChanged(object sender, EventArgs e)
{
if (CheckBox1.Checked == true)
{
CheckBox2.Checked = true;
}
else
{
CheckBox2.Checked = false;
}

The ASP.Net Checkbox Example output is :

Change check status of CheckBox control in ASP.Net with C#

Change check status of CheckBox control in ASP.Net with C#

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

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=”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: 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……..

Enable / Disable CheckBox Control Programmatically in ASP.Net

In this ASP.Net CheckBox Exmaple, How to Enable and Disable CheckBox control Programmatically in ASP.Net with C#.

STEP 1 – Design ASP.Net web form with One CheckBox 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=”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: 464px”>
<tr>
<td colspan=”1″ style=”width: 257px; height: 24px”>
<strong><span style=”font-size: 14pt; color: #6600cc; font-family: Arial”>Enable / Disable
CheckBox 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 Enable / Disable” Font-Bold=”True” /></td>
</tr>
<tr>
<td style=”width: 257px”><asp:Button ID=”btnEnable” runat=”server” OnClick=”btnEnable_Click” Text=”Enable” Font-Bold=”True” />&nbsp;
<asp:Button ID=”btnDisable” runat=”server” OnClick=”btnDisable_Click” Text=”Disable” Font-Bold=”True” Width=”64px” /></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 :

Enable / Disable CheckBox control in ASP.Net with C#

Enable / Disable CheckBox control in ASP.Net with C#

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

protected void btnEnable_Click(object sender, EventArgs e)
{
CheckBox1.Enabled = true;
lblanswer.Text = “CheckBox Enable”;
}
protected void btnDisable_Click(object sender, EventArgs e)
{
CheckBox1.Enabled = false;
lblanswer.Text = “CheckBox Disable”;
}

The ASP.Net Checkbox Example output is :

Enable / Disable CheckBox control in ASP.Net with C#

Enable / Disable CheckBox control in ASP.Net with C#

The ASP.Net Checkbox Example output is :

Enable / Disable CheckBox control in ASP.Net with C#

Enable / Disable CheckBox control in ASP.Net with C#

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

How to Change ChackBox Border Width in ASP.Net

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&nbsp; &nbsp;</span></strong></td>
</tr>
<tr>
<td style=”width: 274px; height: 8px;”>
&nbsp;
</td>
</tr>
<tr>
<td style=”width: 274px; height: 22px; text-align: center;”>
&nbsp;<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 :

CheckBox control in ASP.Net with C#

Change Border width 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.BorderWidth = 3;
}

protected void Button2_Click(object sender, EventArgs e)
{
CheckBox1.BorderWidth = 7;
}

The ASP.Net Checkbox Example output is :

CheckBox control in ASP.Net with C#

Change Border width of CheckBox control in ASP.Net with C#

The ASP.Net Checkbox Example output is :

CheckBox control in ASP.Net with C#

Change Border width of CheckBox control in ASP.Net with C#

I hope this Checkbox control change border width ASP.Net Example will help you…

How to change CheckBox Border Style Programmatically in ASP.Net C#

In this ASP.Net tutorial, How to change Checkbox control Border Style Programmatically in ASP.Net with C#.

STEP 1 – Design the CheckBox control Example web page like:

<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 Style Programmatically&nbsp;</span></strong></td>
</tr>
<tr>
<td style=”width: 274px; height: 8px;”>
&nbsp;
</td>
</tr>
<tr>
<td style=”width: 274px; height: 22px; text-align: center;”>
&nbsp;<asp:CheckBox ID=”CheckBox1″ runat=”server” Text=”CheckBox Font Style” Font-Bold=”True” BorderStyle=”Solid” BorderWidth=”2px” /></td>
</tr>
<tr>
<td style=”width: 274px”><asp:Button ID=”Button1″ runat=”server” OnClick=”Button1_Click” Text=”Dotted Border Style” Font-Bold=”True” />
<asp:Button ID=”Button2″ runat=”server” OnClick=”Button2_Click” Text=”Solid Border Style” Font-Bold=”True” />&nbsp;</td>
</tr>
<tr>
<td style=”width: 274px; text-align: center”>
<asp:Label ID=”lblanswer” runat=”server” Font-Bold=”True” ForeColor=”Maroon”></asp:Label>&nbsp;&nbsp;
&nbsp;
</td>
</tr>
</table>
</td>
</tr>
<tr>
</tr>
</table>

– The ASP.Net Checkbox Example output is :

CheckBox control Border Style in ASP.Net with C#

CheckBox control Border Style in ASP.Net with C#

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

protected void Button1_Click(object sender, EventArgs e)
{
CheckBox1.BorderStyle = BorderStyle.Dotted;
}

protected void Button2_Click(object sender, EventArgs e)
{
CheckBox1.BorderStyle = BorderStyle.Solid;
}

The ASP.Net Checkbox Example output is :

CheckBox control Border Style in ASP.Net with C#

CheckBox control Border Style in ASP.Net with C#

The ASP.Net Checkbox Example output is :

CheckBox control Border Style in ASP.Net with C#

CheckBox control Border Style in ASP.Net with C#

I hope Change Border Style of Checkbox control ASP.Net Example will help you……..

How to change Background Color of CheckBox Programmaticlly

Hi, In this ASP.Net post we are going to learn How to change Chackbox contol Background programmatically in ASP.Net with C#.

STEP 1 – Design the ASP.Net web form like :

<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
Bg Color Programmatically</span></strong></td>
</tr>
<tr>
<td style=”width: 274px; height: 8px;”>
&nbsp;
</td>
</tr>
<tr>
<td style=”width: 274px; height: 22px; text-align: center;”>
&nbsp;<asp:CheckBox ID=”CheckBox1″ runat=”server” Text=”CheckBox Back Ground Color” Font-Bold=”True” /></td>
</tr>
<tr>
<td style=”width: 274px”><asp:Button ID=”Button1″ runat=”server” OnClick=”Button1_Click” Text=”Red BackGround” Font-Bold=”True” /><asp:Button ID=”Button2″ runat=”server” OnClick=”Button2_Click” Text=”Blue BackGround” 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 :

Change Background color CheckBox control in ASP.Net with C#

Change Background color CheckBox control in ASP.Net with C#

The ASP.Net Checkbox Example output is :

Change Background color CheckBox control in ASP.Net with C#

Change Background color CheckBox control in ASP.Net with C#

The ASP.Net Checkbox Example output is :

Change Background color CheckBox control in ASP.Net with C#Change Background color CheckBox control in ASP.Net with C#

Change Background color CheckBox control in ASP.Net with C#

I hope this Change Background color of Checkbox control ASP.Net Example will help you…

Change Label Color According to the Checkbox check Status

In this ASP.Net post, we show you how to change the Label Text color according to change the Checkbox check status.

STEP 1- Design the ASP.Net web page with Three Checkbox control and one Label Control :

<table border=”1″ bordercolor=”#000000″ style=”z-index: 100; left: 272px; position: absolute;
top: 72px”>
<tr>
<td colspan=”3″ style=”width: 582px”>
<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>
<tr>
<td colspan=”2″ style=”height: 24px; text-align: center”>
<strong>Change Color according to CheckBox</strong></td>
</tr>
<tr>
<td style=”width: 181px; height: 24px; text-align: right;”>
</td>
<td style=”width: 255px; height: 24px;”>
&nbsp;<asp:CheckBox ID=”chkRed” runat=”server” Text=”Red” Font-Bold=”True” AutoPostBack=”True” OnCheckedChanged=”chkRed_CheckedChanged” />
&nbsp;&nbsp;
<asp:CheckBox ID=”chkblue” runat=”server” Font-Bold=”True” Text=”Blue” AutoPostBack=”True” OnCheckedChanged=”chkblue_CheckedChanged” />&nbsp;
<asp:CheckBox ID=”chkGreen” runat=”server” AutoPostBack=”True” Font-Bold=”True” OnCheckedChanged=”chkGreen_CheckedChanged”
Text=”Green” /></td>
</tr>
<tr>
<td style=”width: 181px”>
</td>
<td style=”width: 255px”>
<asp:Label ID=”lblanswer” runat=”server” Font-Bold=”True”></asp:Label></td>
</tr>
</table>
</td>
</tr>
<tr>
</tr>
</table>

STEP 2 – write the below code at coding page on ASP.Net aspx.cs page:

 protected void chkRed_CheckedChanged(object sender, EventArgs e)
{
lblanswer.Text = “RED”;
lblanswer.ForeColor = System.Drawing.Color.Red;
chkblue.Checked = false;
chkGreen.Checked = false;
}
protected void chkblue_CheckedChanged(object sender, EventArgs e)
{
lblanswer.Text = “BLUE”;
lblanswer.ForeColor = System.Drawing.Color.Blue;
chkRed.Checked = false;
chkGreen.Checked = false;
}
protected void chkGreen_CheckedChanged(object sender, EventArgs e)
{
lblanswer.Text = “GREEN”;
lblanswer.ForeColor = System.Drawing.Color.Green;
chkRed.Checked = false;
chkblue.Checked = false;
}

The ASP.Net Checkbox Example output is :

Change Lable color according to CheckBox control state in ASP.Net with C#

Change Lable color according to CheckBox control state in ASP.Net with C#

The ASP.Net Checkbox Example output is :

Change Lable color according to CheckBox control state in ASP.Net with C#

Change Lable color according to CheckBox control state in ASP.Net with C#

The ASP.Net Checkbox Example output is :

Change Lable color according to CheckBox control state in ASP.Net with C#

Change Lable color according to CheckBox control state in ASP.Net with C#

How to Check the Check Status of Checkbox in ASP.Net

Here, In ASP.Net Checkbox control Example, we teach you how to know the Check Status of Checkbox control Programmatically in ASP.Net with C#.

STEP 1 – Design the CheckBox ASP.Net web page like :

<table border=”1″ bordercolor=”#000000″ style=”z-index: 100; left: 272px; position: absolute;
top: 72px”>
<tr>
<td colspan=”3″ style=”width: 582px”>
<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>
<tr>
<td colspan=”2″ style=”height: 24px; text-align: center”>
<strong>Check which checbox is Checked</strong></td>
</tr>
<tr>
<td style=”width: 181px; height: 24px; text-align: right;”>
</td>
<td style=”width: 255px; height: 24px;”>
&nbsp;<asp:CheckBox ID=”CheckBox1″ runat=”server” Text=”YES” Font-Bold=”True” />
&nbsp;&nbsp;
<asp:CheckBox ID=”CheckBox2″ runat=”server” Font-Bold=”True” Text=”NO” /></td>
</tr>
<tr>
<td style=”width: 181px”>
</td>
<td style=”width: 255px”>
<asp:Button ID=”btnchecked” runat=”server” OnClick=”btnchecked_Click” Text=”Check” />&nbsp;</td>
</tr>
<tr>
<td style=”width: 181px”>
</td>
<td style=”width: 255px”>
<asp:Label ID=”lblanswer” runat=”server”></asp:Label></td>
</tr>
</table>
</td>
</tr>
<tr>
</tr>
</table>

The ASP.Net Checkbox Example output is :

CheckBox control in ASP.Net with C#

CheckBox control in ASP.Net with C#

STEP 2 – write below code on Button Click Event in ASP.Net aspx.cs page:

    protected void btnchecked_Click(object sender, EventArgs e)
{
if (CheckBox1.Checked == true && CheckBox2.Checked==false)
{
lblanswer.Text = “YES is Selected”;
}
else if(CheckBox2.Checked==true && CheckBox1.Checked==false)
{
lblanswer.Text = “NO is Selected”;
}
else if (CheckBox1.Checked == true && CheckBox2.Checked == true)
{
lblanswer.Text = “BOTH are Selected”;
}
else
{
lblanswer.Text = “BOTH are Un-Selected”;
}
}

The ASP.Net Checkbox Example output is :

CheckBox control in ASP.Net with C#

CheckBox control in ASP.Net with C#

The ASP.Net Checkbox Example output is :

 CheckBox control in ASP.Net with C#

CheckBox control in ASP.Net with C#

The ASP.Net Checkbox Example output is :

CheckBox control in ASP.Net with C#

CheckBox control in ASP.Net with C#

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