yjq说的有道理,你可能在Formcreate里操作
memo的lines或者其他造成数组越界

解决方案 »

  1.   

    MDI的子窗体创建,是可以这样的,至于List index out of bound(0)'的问题和
    UseForm:=TUseForm.create(self);无关。问题应该出在StringGrid之类的控件中。
    Field的长度与实际的字符串长度不符导致的。
      

  2.   

    这种问题我也遇到过,不会是MDI的问题.极可能是其他数组变量或属性(如Items, Lines等)没初始化又引用引起的.
      

  3.   

    I agree with Lin, I meeted this problem too. NOT MDI , check other code.
      

  4.   

    在生成MDIChild子窗体前应判断此窗体是否存在,我一直这样做,从未出现过问题。
    下面是程序的代码:
    {MDIMainForm是主窗体;IMRegisterForm是子窗体}if MDIMainForm.MDIChildCount=0 then
    begin
      ChildIndex:=0;
     while (ChildIndex<MDIMainForm.MDIChildCount) and
          (MDIMainForm.MDIChildren[ChildIndex].Name<>IMRegisterForm.Name) do
        Inc(ChildIndex);
     if ChildIndex = MDIMainForm.MDIChildCount then
        {create new child here}
      begin
       Application.CreateForm(TIMRegisterForm,IMRegisterForm);
      end
     else
        {child form already exists so just bring it to the top}
        MDIMainForm.MDIChildren[ChildIndex].BringToFront;
      

  5.   

    建议单步跟踪程序以确定问题所在,MDI本身应该没有什么问题