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