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 const em_scroll = &hb5
'private const sb_linedown = 1
dim sline as integer
dim lcount as integer
'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 range"
end if
'unload form3
' form3.text1.setfocus
end sub
private sub command2_click()
unload me
end sub
private sub form_activate()
form_load
end sub
private sub form_load()
text1.selstart = 0
if text1.text = "" then
text1.text = 0
else
text1.text = lcount
end if
text1.sellength = len(lcount)
form3.show
form3.text1.setfocus
end sub