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

Posted by Chikul under VB.NET category on | Views : 38065
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.

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

Comments or Responses

Login to post response