Pages

Total Pageviews

Add This

Sunday, May 15, 2011

Calculate the Line Length in TextBox

Calculating the line length in textbox while you write is very easy. You have to put this code into the textbox event textchanged. To do not make mistakes i give you the code with the event.


    Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
        For Each line As String In TextBox1.Lines
            Label1.Text = line.Length
        Next
    End Sub

No comments:

Post a Comment