Hi,
Can anyone tell me how to determine how many lines are visible inside a textbox ?
thanks a lot
Ruther
Printable View
Hi,
Can anyone tell me how to determine how many lines are visible inside a textbox ?
thanks a lot
Ruther
I dont know what text will appear in the textbox, but you might count the enter -signs
use this for a text box
and this for a Rich text BoxCode:Public Function NumberOfLines(TextBox As TextBox) As Integer
Dim sLines() As String
sLines() = Split(TextBox.Text, vbCrLf)
NumberOfLines = UBound(sLines)
End Function
Code:Public Function NumberOfLines(TextBox As RichTextBox) As Integer
Dim sLines() As String
sLines() = Split(TextBox.Text, vbCrLf)
NumberOfLines = UBound(sLines)
End Function