TextBox "auto" height

NicoVB

Centurion
Joined
Jan 2, 2002
Messages
160
Location
Belgium
I have a textbox filled with some dynamic text. I want that I can make the textbox programmaticaly (or automatically) so high that i don't have to scroll to so all of the content (all the content should be displayed right on the screen).

How to do this???
 
not sure if this will give you any ideas , but you could resize ( depending on the size of the text ofcourse ) on the amount of lines :
Visual Basic:
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim x As Integer
        Dim i As Integer = 20
        For x = 0 To TextBox1.Lines.GetUpperBound(0)
            If Not x = 0 Then
                i += 20
            End If
        Next
        TextBox1.Height = i
    End Sub
 
Back
Top