查看: 3681|回复: 0

实训

[复制链接]
发表于 2008-4-25 08:23:15 | 显示全部楼层 |阅读模式
1 openfiledialog控件的使用
所使用的控件  RichTextBox Button(2个) openfiledialog
Button1.Text="打开文件"  Button2.Text="退出"
代码如下:
Form_Load()
  with openfiledialog1
    .checkfileexists=true
    .multiselect=false
    .filter="文件类型(*.txt)|*.txt"
    .InitialDirectory="c:\"
    .showreadonly=true
    .showhelp=true
    .ReadOnlyChecked=True
end with
Button1_click()
  if (openfiledialog1.showdialog=dialogresult.ok) and (openfiledialog1.filename.length>0) then
       richetextbox1.loadfile(openfiledialog1.filename)
  end if
  if openfiledialog1.ReadOnlyChecked=true then
     richtextbox1.readonly=true
  else
     richtextbox1.readonly=false
  endif
sub button2.click()
   me.close()
end sub
要求:1 调试上述代码
2 给出注释
3 不许粘贴复制
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关注公众号
手机版|小黑屋|联系站长|帮助中心| 河北软件学院门户网

相关侵权、举报、投诉及建议等,请发 E-mail:kuns@126.com

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖
关注公众号
QQ客服返回顶部