How to Set or Change Label Control Border Width Programmatically in asp.net

1.File-> New-> Website->  ASP.NET Web Site(Visual C#) -> Ok

(Now You will see a Default.aspx page. To create your own page->click on dropdown list below Edit->click Add new item->Select Web Form->click Add)


2.ToolBox-> Drag and Drop a Label to Design window->Right click on label->select properties->(look for text property) change text property from label to Label Control Border Width Set or Change Example

3.ToolBox->Drag and Drop Two Button on design window->Right click on Button one->select properties->(look for text property) change text property from Button to  Border Width 2
->Also change Button two Text property to  Border Width 4
Your Design Window should look like this 
Set Label Border width






4.Double click on Button1(Border Width 2 Button) to get the code behind->Write this code
5.Double click on Button1(Border Width 4 Button) to get the code behind->Write this code
6.Click F5 to run your project.
Set label Border Width programmatically











Set label Border Width programmatically












Set label Border Width programmatically
 

How to Set or Change Label Text ForeColor(Font Color) Programmatically in asp.net

1.File-> New-> Website->  ASP.NET Web Site(Visual C#) -> Ok

(Now You will see a Default.aspx page. To create your own page->click on dropdown list below Edit->click Add new item->Select Web Form->click Add)


2.ToolBox-> Drag and Drop a Label to Design window->Right click on label->select properties->(look for text property) change text property from label to This Label ForeColor(Font Color) will change when clicking the Button.

3.ToolBox->Drag and Drop Two Button on design window->Right click on Button one->select properties->(look for text property) change text property from Button to  ForeColor BlueViolet
->Also change Button two Text property to  ForeColor DarkOrange
Your Design Window should look like this 
Label Forecolor(Text,Font Color) Set or Change Programmatically







4.Double click on Button1(ForeColor BlueViolet Button) to get the code behind->Write this code
5. Double click on Button2(ForeColor DarkOrange Button) to get the code behind->Write this code
 6.Click F5 to run your project.
Label ForeColor(Text,Font) Set or Change Programmatically








Label ForeColor(Text,Font) Set or Change Programmatically










Label ForeColor(Text,Font) Set or Change Programmatically
 

How to Show or Hide Label programmatically in asp.net

1.File-> New-> Website->  ASP.NET Web Site(Visual C#) -> Ok

(Now You will see a Default.aspx page. To create your own page->click on dropdown list below Edit->click Add new item->Select Web Form->click Add)


2.From ToolBox Drag and Drop a Label to Design window->Right click on label->select properties->(look for text property) change text property from label to This Label will Hide when Button Click

3.ToolBox->Drag and Drop Two Button on design window->Right click on Button one->select properties->(look for text property) change text property from Button to  Hide Label
->Also change Button two Text property to  Show Label
Your Design Window should look like this 
Show or Hide Label














4.Double click on Button1(Height50 Button) to get the code behind->Write this code
5. Double click on Button2(Height100 Button) to get the code behind->Write this code
6.Click F5 to run your project.
Label Hide or Show Programmatically
  




Label Hide or Show Programmatically











Label Hide or Show Programmatically
 

How to set or Change Label Control Height Programmatically in asp.net

1.File-> New-> Website->  ASP.NET Web Site(Visual C#) -> Ok

(Now You will see a Default.aspx page. To create your own page->click on dropdown list below Edit->click Add new item->Select Web Form->click Add)


2.From ToolBox Drag and Drop a Label to Design window->Right click on label->select properties->(look for text property) change text property from label to Label Height Changing Example ->also set BackClor property to #6699FF(so that height change will be visible clearly)


3.ToolBox->Drag and Drop Two Button on design window->Right click on Button one->select properties->(look for text property) change text property from Button to Height 50
->Also change Button two Text property to Height 100
Your Design Window should look like this 
Label Height Changing Example














4.Double click on Button1(Height50 Button) to get the code behind->Write this code
5. Double click on Button2(Height100 Button) to get the code behind->Write this code
6.Click F5 to run your project.
Label Height Changing programmatically









Label Height Changing programmatically









How to set or Change Label Control Width Programmatically in asp.net

1.File-> New-> Website->  ASP.NET Web Site(Visual C#) -> Ok

(Now You will see a Default.aspx page. To create your own page->click on dropdown list below Edit->click Add new item->Select Web Form->click Add)


2.From ToolBox Drag and Drop a Label to Design window->Right click on label->select properties->(look for text property) change text property from label to Label Width Changing Example 


3.ToolBox->Drag and Drop Two Button on design window->Right click on Button one->select properties->(look for text property) change text property from Button to Width 100
->Also change Button two Text property to Width 300 
Your Design Window should look like this 
Label Width Changing Programmatically Design window








4.Double click on Button1(Width100 Button) to get the code behind->Write this code
5. Double click on Button2(Width300 Button) to get the code behind->Write this code
6.Click F5 to run your project
Label Width Changing Example















Label Width Changing Example





















How to use ToolTip in Label Control in asp.net

1.File-> New-> Website->  ASP.NET Web Site(Visual C#) -> Ok

(Now You will see a Default.aspx page. To create your own page->click on dropdown list below Edit->click Add new item->Select Web Form->click Add)


2.From ToolBox Drag and Drop a Label to Design window->Right click on label->select properties->(look for text property) change text property from label to Label Control ToolTip Example->Set ToolTip property to   ToolTip on Label Control
ToolTip in Label Control







ToolBox->Drag and Drop a Label to Design window->Right click on label->select properties->(look for text property) change text property from label to This is a ToolTip Example->Set ToolTip property to  
 ToolTip Example two

3.Click F5 to run Your project
ToolTip property on label control










ToolTip property on label control

How to checked RadioButton Control when Page Load in asp.net

1.File-> New-> Website->  ASP.NET Web Site(Visual C#) -> Ok

(Now You will see a Default.aspx page. To create your own page->click on dropdown list below Edit->click Add new item->Select Web Form->click Add)


 2.ToolBox-> Double Click on Label(or drag and drop Label on Design view)-> Right click on Label->Select Properties->change Text properties to  Select your Gender?


3.ToolBox-> Double Click on RadioButton->Right click on RadioButton->Select properties->Change text properties to Male

ToolBox-> Double Click on RadioButton->Right click on RadioButton->Select properties->Change text properties to Female 
Your Design window should look like this
RadioButton Control Design window















4. Right click on Male RadioButton(RadioButton1)->View code(to get the code behind)
And write this code

5.Click F5 to run your project
RadioButton Control Page Load
 

How to call and use OnCheckedChanged Event in RadioButton in Asp.Net

1.File-> New-> Website->  ASP.NET Web Site(Visual C#) -> Ok

(Now You will see a Default.aspx page. To create your own page->click on dropdown list below Edit->click Add new item->Select Web Form->click Add)


 2.ToolBox-> Double Click on Label(or drag and drop Label on Design view)-> Right click on Label->Select Properties->change Text properties to  Select your Gender?

3. ToolBox-> Double Click on RadioButton->Right click on RadioButton->Select properties->Change text properties to Male->AutoPostBack properties to True->GroupName properties to RadioButtonControl
RadioButton Control Properties





















  ToolBox-> Double Click on RadioButton->Right click on RadioButton->Select properties->Change text properties to Female->AutoPostBack properties to True->GroupName properties to RadioButtonControl

4.ToolBox-> Double Click on Label-> Right click on Label->Select Properties->change Text properties to
 Blank(delete the label text so when you  run nothing will show)
 Your Design window should look like this
RadioButton Control Design window












5.Right click on Male RadioButton(RadioButton1)->properties->Click Events->Double click on CheckedChanged events(to get the code behind)











And write this code:

6..Right click on Female RadioButton(RadioButton2)->properties->Click Events->on CheckedChanged events DropDownList select RadioButton_CheckedChanged(it is the event name which we created on our first RadioButton's CheckedChanged Event)

7.Click F5 to run your project.
RadioButton Control  Output
After Running the project















When Male RadioButton Control Event
After clicking Male RadioButton












When Male RadioButton Control Event
After Clicking Female RadioButton