Find Code:
All Words
Any of the Words
Exact Phrase
Home
:
Code
:
Forums
:
Submit
:
Mailing List
:
About
:
Contact
Code
All
VB.NET
ASP.NET
C#
VB Classic
ASP Classic
Snippets
Popular
Resources
Submit Code
Forums
Articles
Tips
Links
Books
Contest
Link to us
Changing The Text - Asp.Net 2005
Author:
Divya M
E-mail:
Click to e-mail author
Submitted:
1/17/2011
Version:
ASP.NET 2.0
Compatibility:
ASP.NET 2.0, ASP.NET 3.5
Category:
ASP.NET
Views:
8890
Changing the font color, size face and bold the text using asp.net 2005 version...
Declarations:
Steps For Creation:- ==================== 1. Open a new website and rename it. 2. Place a panel and place 3 labels rename it in properties window. 3. Place 4 buttons and rename it as color,font,size and bold. 4. Double click each to write code given below. 5. Save all and run the project and click on each button to display text changing.
Code:
Partial Class _Default Inherits System.Web.UI.Page Protected Sub btnColor_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnColor.Click Dim red As Integer = 100 Dim green As Integer = 100 Dim blue As Integer = 100 Label1.ForeColor = System.Drawing.Color.FromArgb(red, green, blue) Label2.ForeColor = System.Drawing.Color.Red Label3.ForeColor = System.Drawing.ColorTranslator.FromHtml("green") End Sub Protected Sub btnFont_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnFont.Click Label1.Font.Name = "Forte" Label2.Font.Name = "Broadway" Label3.Font.Name = "Calibri" End Sub Protected Sub btnSize_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSize.Click Label1.Font.Size = FontUnit.Larger Label2.Font.Size = FontUnit.Larger Label3.Font.Size = FontUnit.Larger End Sub Protected Sub btnBold_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnBold.Click Label1.Font.Bold = True Label2.Font.Bold = True Label3.Font.Bold = True End Sub End Class
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2023 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement