Showing posts with label Label Control. Show all posts
Showing posts with label Label Control. Show all posts

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 change Background color of label programmatically in ASP.NET

 1.File->New->Website->(left side select visual c#) ASP.NET Web Site->ok

2.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

3. Click Split(to see Design and code View simultaniously)->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 text will change when i click the Button".

4.Drag and drop a button below label->Right click on Button->select properties->change text property from Button to "change back color.Your window should look like this.


How to Set or Change Label Text Programmatically in ASP.NET

1.File->New->Website->(left side select visual c#) ASP.NET Web Site->ok

2.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->Add(you can change the name,here i change it from Default2.aspx To LabelControl.aspx)


3.Click Split(to see Design and code View simultaniously)->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 text will change when i click the Button".