Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As LongPrivate Const EM_GETLINECOUNT = & HBA'Private Const EM_SCROLL = & HB5'Private Const SB_LINEDOWN = 1Dim Sline as integerim lcount as in
'End Sub
Private Sub Command1_Click () Dim i As Integer Form1.Text1.SelStart = 0 Form1.Text1.SetFocus Sline = SendMessage (Form1.Text1.hwnd, EM_GETLINECOUNT, 0 &, 0 &) Lcount = CInt (Text1.Text) If Lcount <= Sline Then for i = 1 to LCOUNT - 1 SendKeys "{down}" Next I form3.hide else msgbox "line over er" end if 'unload form3' form3.text1.setfocusend SUB
Private submmand2_click () unload mend Sub
PRIVATE SUB FORM_ACTIVATE () FORM_LOADEND SUB
Private sub flow_load ()
TEXT1.SELSTART = 0if text1.text = "" THEN TEXT1.TEXT = 0ELSE text1.text = LCOUNTEND IF
TEXT1.SELLENGTH = LEN (LCOUNT) Form3.ShowForm3.Text1.Setfocusend Sub