.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal

Home >> Code Snippets >> ASP.NET Controls >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Use Track Bar to Change the Font Size of the label Dynamically

Posted By:Prasanti Prusty       Posted Date: December 18, 2009    Points: 10    Category: ASP.NET Controls    URL: http://www.dotnetspark.com  

Change the Font Size Dynamically of the Label by drag the TrackBar.
Drag and drop one Label(Name - lblDisply) & one Track Bar
Then Write the coding in TrackBar1_Scroll() Event.

Code :
Public Class frmUseTrackBar
Private Sub TrackBar1_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TrackBar1.Scroll
lblDisply.Font = New System.Drawing.Font("Microsoft Sans Serif", (9 + CType(TrackBar1.Value, Double)), System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
' 9 + CType(TrackBar1.Value, Double) : 9 - For Intial Font Size. TrackBar1.Value - Increase the Font size using this value
End Sub
End Class


Further Readings:


No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend