Have you found ,why is your program is slow down.As for as I can tell one thing.If you read the length of line which is more , then it will slow.For Getting the length
you have to use this function
VB Code:
  1. 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
  2. Const WM_GETTEXTLENGTH As Long = &HE
  3.  
  4. Private Function Getlength(rich As RichTextBox) As Long
  5.   'Function To get the length of the text box
  6.   Getlength = SendMessage(rich.hwnd, WM_GETTEXTLENGTH, 0&, 0&)
  7. End Function