★★★敬请留意★★★:和微软一模一样的记事本的源代码(3)

[入库:2005年8月18日] [更新:2007年3月24日]

本文简介:选择自 deak 的 blog

 

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

 

本文关键:和微软一模一样的记事本
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top