找回密码
 注册

扫一扫,访问微社区

查看: 3186|回复: 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 不许粘贴复制
您需要登录后才可以回帖 登录 | 注册

本版积分规则

网络开发 全网营销 全案服务

QQ|手机版|小黑屋|联系站长|河北软件职业技术学院论坛

GMT+8, 2024-4-27 23:54

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表