for I := MDIChildCount-1 downto 0 do
begin
  if MDIChildren[I].caption='normal40' then
  begin
    MDIChildren[I].memo1.Add('vdsfgds');
  end;
end;

解决方案 »

  1.   

    for I := MDIChildCount-1 downto 0 do
    begin
      if MDIChildren[I].caption='normal40' then
      begin
        MDIChildren[I].memo1.Add('vdsfgds');
        break;
      end;
    end;
      

  2.   

    呵呵,在Button2的OnClick中写:
    with TForm2.Create(Self) do
    begin
      Caption := Self.Edit1.Text;
    end;
    这样就行了,每个窗体都是独立的对象的,你在其中任一个的Memo中加内容都不会影响其它窗体的
      

  3.   

    uses TForm2;
    .....
    var I;integer;
    ...
    begin
    ....
    for i:=0 to MDIChildCount-1 do
        Tform2(MDIChildren[i]).Memo.lines.add('文本');
    ....
      

  4.   

    在form1中添加uses TForm2;
    .....
    var I;integer;
    ...在Button2的OnClick中写:begin
    ....
    for i:=0 to MDIChildCount-1 do
        Tform2(MDIChildren[i]).Memo1.lines.add('文本');
    ....
      

  5.   


    to fredfei(飞飞): 
    Tform2(MDIChildren[i]).Memo1 这个什么意思?***********************************8
    问题是我的form2不是自动创建的,能够用MDIChildren[i].Memo1吗?
    当我写form1.mdichildren[i].的时候.出来的还是mdichild[i]:Tform;
    而没有出现var Memo1:Tmemo;
    晚上回去做个实验,明天给大家分数~~~
      

  6.   

    在implementation后不是引用了form2了吗uses Form2Unit;    //你form2的单元名Tform2(MDIChildren[i])
    意思是把当前第i个子窗口当作Tform2类型来使用MDIChildren[i]本身是没有memo1的,经过转换以后就成了Tform2类,它有memo1呀。