Private Declare Function SendMessage Lib "USER32" Alias "SendMessageA" _
(ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, _
lParam As Any) As Long
Private Const EM_GETLINECOUNT = &HBA
Private Sub RichTextBox1_KeyPress(KeyAscii As Integer)
Dim i As Long
i = SendMessageByNum(RichTextBox1.hWnd, EM_GETLINECOUNT, 0, 0)
If i > 999 Then KeyAscii = 0
End Sub
Private Sub RichTextBox1_KeyPress(KeyAscii As Integer)
Dim i As Long
i = SendMessageByNum(RichTextBox1.hWnd, EM_GETLINECOUNT, 0, 0)
If i > 999 Then KeyAscii = 0
End Sub