Make Label text Bold, Italic and change bacground color programmatically in Asp .Net

 Write a program to change text of Label control to Bold, Italic and change its Background and Forecolor programmatically.

HTML

 
<%--//===== Label to show output.--%>


CodeBehind

protected void btnBold_Click(object sender, EventArgs e)
    {
        lblResult.Font.Bold = true;
    }
    protected void btnItalic_Click(object sender, EventArgs e)
    {
        lblResult.Font.Italic = true;
    }
    protected void btnBackGroundColor_Click(object sender, EventArgs e)
    {
        lblResult.BackColor = Color.Blue;
        lblResult.ForeColor = Color.White;
    }

Final Output

programmatically-make-text-bold-italic-backcolor-change-asp-net-practical-question-codingfusion

 
We are nothing without our users ! You can help us offer even more high quality content. Please share our page !
Best quality Asp .Net Ajax Control Toolkit tutorials.
how to highlight textbox value in gridview in asp.net when searching for a value
22-Nov-2013 From  reddy

Give your valuable comments.

Name
Email
Comment
1 + 3 =
 
About Us | Terms of Use | Privacy Policy | Disclaimer | Contact Us Copyright © 2012-2019 CodingFusion
75 Important SQL Server queries you should know