用vb菜单编辑器编辑打开,保存等功能,看看我的代码,Private Sub mnufileopen_Click() CommonDialog1.Filter = "all files(*.*)|*.*|text_files(*.txt)|*.txt|batch files(*.bat)|*.bat"
 
 CommonDialog1.FilterIndex = 2
 
 CommonDialog1.ShowOpen
 openfile (CommonDialog1.FileName)
End Sub
主要是最后一句,是不是要给openfile 定义啊,要是定义,定义成哪个函数啊,

解决方案 »

  1.   

    dim openfile as string
    openfile=CommonDialog1.FileName
      

  2.   

    你是要打开CommonDialog1.FileName返回的文件吧?
    啊是在自己的文本控件(*.txt)里打开啊?
      

  3.   

    dim openfile as string
    openfile=CommonDialog1.FileName
    openfile 就是你取得的文件名和路径了
      

  4.   

    call openfile (CommonDialog1.FileName)
    加call,或者openfile 参数.
    至于openfile应该是你自己写的一个过程.
      

  5.   

    是啊,因为CommonDialog1.FileName返回文件名和路径字符串.
      

  6.   

    sub openfile(Path as string)
        open path for output as #1
            ...
        close #1
    end sub