如何限定MDI每次只能启动一个子窗体

解决方案 »

  1.   

    在要启动的第一个窗体的show下面,
    添加不要启动的窗体的hide
    produre form1.show
    begin
    form2.hide;
    ……
    end;
      

  2.   

    子窗体(ff)的OnClose:
    Action := caFree;
    ff := nil;主窗体:if ff = nil then
       ff := Tff.Create(nil);
    ff.Show;
      

  3.   

    if frmMDIParent.ChildCount=0 then
      

  4.   

    如果MDI每次只能启动一个子窗体的话,还不如不用MDI,用SDI更好
      

  5.   

    子窗体的OnClose:
    Action := caFree;
    frmChild1 := nil;主窗体:
    if frmChild1  = nil then
       frmChild1 := TfrmChild1 .Create(nil);
    frmChild1 .Show;
    就可以了