急,在线等。

解决方案 »

  1.   

    FMenu: TMenuItem;
      NewChildClass: TFormClass;
      NewChildForm: TForm;procedure TFrmMain.ItemClick(Sender: TObject);
    begin  if Assigned(NewChildForm) then
      begin
        try
          NewChildForm.Free;
        finally
          FMenu.Enabled := True;
        end;
      end;  case (Sender as TMenuItem).tag of
        11: NewChildClass := TFrmaa;
        12: NewChildClass := TFrmbb;
        13: NewChildClass := TFrmcc;    21: NewChildClass := TFrmdd;
        22: NewChildClass := TFrmee;    31: NewChildClass := TFrmff;
        32: NewChildClass := TFrmgg;    75: NewChildClass := TFrmDBBackup;
      else
        NewChildClass := nil;
      end;  if Assigned(NewChildClass) then
      begin
        NewChildForm := NewChildClass.Create(Application);
        with NewChildForm do
        try
          Hint := Comname;
          BorderStyle := bsNone;
          BorderIcons := [];
          Parent := Self.Panel1;
          WindowState := wsMaxiMized;
          Align := alClient;
          Show;
        finally
          FMenu := Sender as TMenuItem;
          FMenu.Enabled := False;
        end;
      end;
      Self.Caption := Comname + '管理系统 -> ' + NewChildForm.Caption;
    end;
      

  2.   

    在你主窗体上点击的选项的ONCLICK事件中的最后一行加上  CLOSE;就行了。
      

  3.   

    就象这样
    procedure TFrom1.botton1Click(Sender: TObject);
    begin
    form2.show;
    close;
      end;
    我也是新手,这是我的用法。
      

  4.   

    不可能把主窗体关闭的,只能用HIDE方法,隐藏它,当关闭子窗体的时候再调用SHOW方法显示!
      

  5.   

    主窗体不能关闭的,关闭了主窗体你的自创体也都被关掉了
    只能用hide方法,或者visible属性设为false