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

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

本文简介:选择自 deak 的 blog


option explicit

private sub cancelbutton_click()
okbutton_click
form1.text1.seltext = text2.text
end sub

private sub command1_click()
 if fstring = "" then
    fstring = text1.text
else
    if text1.text <> fstring and text1.text <> "" then
    fstring = text1.text
    end if
   
end if
   
for startpos = 0 to len(form1.text1)
    if check1.value = 1 then
        foundpos = form1.text1.find(fstring, startpos, , 4)
   
    else
        foundpos = form1.text1.find(fstring, startpos)
    end if
    if foundpos <> -1 then
        form1.text1.seltext = text2.text
   
    end if
next startpos
end sub

private sub command2_click()
unload me
end sub

private sub form_load()
okbutton.enabled = false
cancelbutton.enabled = false
command1.enabled = false
end sub

private sub okbutton_click()

   if fstring = "" then
    fstring = text1.text
else
    if text1.text <> fstring and text1.text <> "" then
    fstring = text1.text
    end if
   
end if
   
    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

'gstring = fstring
end sub

private sub text1_change()

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


end sub

本文关键:和微软一模一样的记事本
 

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

go top