Hey guys!

I'm trying to change a textbox font size at run time with a track bar.

But, when I add to my code:

Textbox1.Font.Size = Trackbar1.Value

It says that Font.Size is a read only value. I haven't found any other way to do it.
There is a way to do this?


Thanks!

See if this helps.

Dim fontName As FontFamily = TextBox1.Font.FontFamily '// Get the Current Font Name used.
        TextBox1.Font = New Font(fontName, TrackBar1.Value) '// Set Font Name and Size.

Edited 5 Years Ago by codeorder: n/a

It worked! Thanks guys!

Private Sub TrackBar1_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TrackBar1.ValueChanged
        boxTextoInvertido.Font = New Font("Lucida Sans Unicode", TrackBar1.Value) '// Set Font Name and Size.
    End Sub

    Private Sub TrackBar2_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TrackBar2.ValueChanged
        boxTextoOriginal.Font = New Font("Lucida Sans Unicode", TrackBar2.Value) '// Set Font Name and Size.
    End Sub
This question has already been answered. Start a new discussion instead.