定义一个文本文件变量,用Memo将文本变量内容列出,opendialog负责为文本文件变量传文件名

解决方案 »

  1.   

    opendialog只是一个界面,真正的文件操作的另外写
    var txtfile:TextFile
    var s:string;
    begin
       assignfile(txtfile,opendialog1.filename);
       reset(txtfile);// rewrite(file);
       readln(txtfile,s)
    end;
      

  2.   

    memo.lines.loadfromfile(opendialog1.filename);
      

  3.   

    var s:string;
        s:=opendialog1.filename;
        shellexecute(...); //忘了参数
      

  4.   

    简单,打开一个opendialog的filename的string属性,用这一个东西做为memo等类似控件的属性就可以了。