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

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

本文简介:选择自 deak 的 blog

 

public sub command1_click()
dim foundpos as integer
if fstring = "" then
    fstring = text1.text
else
    if text1.text <> fstring and text1.text <> "" then
    fstring = text1.text
    end if
   
end if

if option1.value = true then
    endpos = form1.text1.selstart
    form1.text1.selstart = 0
    startpos = 0
    do while foundpos <> -1
        if check1.value = 1 then
        foundpos = form1.text1.find(fstring, startpos, endpos, 4)
            if foundpos <> -1 then startpos = foundpos + len(fstring)
        else
        foundpos = form1.text1.find(fstring, startpos, endpos)
            if foundpos <> -1 then startpos = foundpos + len(fstring)
        end if
    loop
    if startpos = 0 then
       ' startpos = startpos - len(fstring)
          
   ' else
       msgbox "find   not   " + chr(34) + fstring + chr(34)
    end if
else
    startpos = form1.text1.selstart + form1.text1.sellength
    endpos = len(form1.text1)
    if check1.value = 1 then
        foundpos = form1.text1.find(fstring, startpos, endpos, 4)
   
    else
        foundpos = form1.text1.find(fstring, startpos, endpos)
    end if
    if foundpos <> -1 then
        startpos = foundpos + 1
    else
        msgbox "find   not   " + chr(34) + fstring + chr(34)
    end if
end if

end sub

private sub command2_click()
form2.visible = false
end sub

private sub form_load()
command1.enabled = false
tchange = false
endpos = lenb(form1.text1)
end sub

private sub text1_change()

if text1.text <> "" then
    command1.enabled = true
else
    command1.enabled = false
   
end if
tchange = true

end sub

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

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

go top