Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
50
UltraTextEditor1 Multiline count
posted

On a TextBox I can calculate the number on lines with the following code:

 Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged

    linecount = SendMessage(TextBox1.Handle.ToInt32, EM_GETLINECOUNT, -1, 0)
    lblLine1.Text = "Line Count: " & (linecount).ToString
    lblLine2.Text = "Char Count: " & TextBox1.Text.Length

    If linecount > 6 Then
      TextBox1.Focus()
      SendKeys.Send("{BKSP}")
    End If

  End Sub

When I use an UltraTextEditor control  the code does not work.

I need to restrict the number the lines. Is there a way to do this?

John 

Parents Reply Children