Recently research text controls and strings, studying heads and brain, the problem is too much. This is only one of the problems, the answer comes from the expert website and 9CBS Technofantasy (www.applevb.com), solve the following: public const wm_user = & h400public const EM_SETTARGETDEVICE = (WM_USER 72) Public Declare Function Getdc lib "user32" (ByVal hWnd As Long) As LongPublic Declare Function SendMessage Lib "user32" Alias "SendMessageA" _ (ByVal hWnd As Long, _ ByVal wMsg As Long, _ ByVal wParam As Long, _ lParam As Any) As LongPublic Sub AutoSwitchLine (ByRef RichText As Long , ByVal bSwitch As Boolean) If bSwitch Then 'provided RichTextBox wrap Call SendMessage (RichText.hWnd, EM_SETTARGETDEVICE, _ GetDC (RichText.hWnd), RichText.Width / 15) If RichText.RightMargin = 0 Then RichText.RightMargin = 1 Else Richtext.rightmargin = 0 END IF ELSE 'Setting RichtextBox does not automatically wrap Call sendMessage (Richtext.hwnd, EM_SETTARGETDEVICE, 0, 1) end ifend sub