请教下面代码错在哪里?(0分)

  • 主题发起人 windows.net
  • 开始时间
W

windows.net

Unregistered / Unconfirmed
GUEST, unregistred user!
var FileMemo,tempMemo:tmemo;
i:integer;
begin
if OpenDialog1.Execute then
begin
try
FileMemo:=tmemo.Create(self);
tempMemo:=tmemo.Create(self);
fileMemo.Lines.LoadFromFile(OpenDialog1.FileName);
for i:=0 to fileMemo.Lines.Count-1 do //程序编译时提示这里出错,
//错误信息:project project2.exe raised exception class einvalidoperotion with message 'control'' has no parent window',process stopped.user step or run to continue.

begin
tempMemo.Text:=FileMemo.Lines.Strings;
tempMemo.Lines.SaveToFile('c:/'+inttostr(i));
end;
finally
fileMemo.Free;
tempMemo.Free;
end;
end;
 
FileMemo:=tmemo.Create(self);
tempMemo:=tmemo.Create(self);
这里加上:
filememo.Parent:=form1;
tempMemo.Parent:=form1;
....................
..................
 
呵呵,直接用TStringList不好么,干吗用TMemo。
 
没分,气死我了
 
顶部