及注释
程序清单6.1
option explicit
dim filename as string ''文件名,用于打开、保存文件
dim undostring as string ''用于 undo 操作
dim undonew as string ''用于 undo 操作
private sub imgundodisable()
''禁用“undo”按钮
undostring = ""
undonew = ""
imgundo.enabled = false
imgundo.picture = imagedisable.listimages("undo").picture
end sub
private sub imgundoenable()
''有效“undo”按钮
imgundo.enabled = true
imgundo.picture = imageup.listimages("undo").picture
end sub
private sub check_imgpaste()
''设置粘贴按钮
if len(clipboard.gettext) > 0 then
imgpaste.enabled = true
imgpaste.picture = imageup.listimages("paste").picture
else
imgpaste.enabled = false
imgpaste.picture = imagedisable.listimages("paste").picture
end if
end sub
private sub check_imgcutcopy()
''设置剪切、复制按钮
if text1.sellength > 0 then
imgcut.enabled = true
imgcut.picture = imageup.listimages("cut").picture
imgcopy.enabled = true
imgcopy.picture = imageup.listimages("copy").picture
else
imgcut.enabled = false
imgcut.picture = imagedisable.listimages("cut").picture
imgcopy.enabled = false
imgcopy.picture = imagedisable.listimages("copy").picture
end if
end sub
private sub backcolor_click()
commondialog1.showcolor
text1.backcolor = commondialog1.color
end sub
private sub box_click()
''显停工具栏
if box.checked then
''将停显工具栏
box.checked = false
coolbar1.visible = false
else
box.checked = true
coolbar1.visible = true
end if
form_resize ''重新调整控件位置
end sub
private sub close_click()
dim filenum as integer
if len(filename) > 0 then
''有输入文件名
filenum = freefile() ''获得可用文件号
open filename for output as filenum ''打开输出文件
''如果无指定文件,则创建新文件
print #filenum, text1.text ''输出文本
close filenum ''关闭文件
end if
text1.text = ""
filename = ""
end sub
private sub combosize_click()
text1.fontsize = val(combosize.text)
end sub
private sub combofont_click()
text1.fontname = combofont.text
end sub
private sub copy_click()
clipboard.settext text1.seltext ''复制文本到剪裁板
end sub
private sub cut_click()
clipboard.settext text1.seltext ''复制文本到剪裁板
text1.seltext = "" ''清选择的文本
end sub
private sub datatime_click()
text1.seltext = now
end sub
private sub delete_click()
text1.上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] 下一页