错误说明:
cannot make a visible windows modal我是在一个form的button.click中想动态产生一个新的form2
procedure TForm1.N4Click(Sender: TObject);
var
 ActiveForm:TActiveForm;begin
 ActiveForm:=Tactiveform.Create(application);
  ActiveForm.show;
end;

解决方案 »

  1.   

    ActiveForm:=Tactiveform.Create(application);
    ActiveForm.Visible:=False;
    ActiveForm.show;
      

  2.   

    在Project->Option里把ActiveForm从Auto-Create里去掉
      

  3.   

    好像不是这个事
    你应该是调用ShowModal产生这个错误
    搜索源代码如下
      SCannotShowModal = 'Cannot make a visible window modal';function TCustomForm.ShowModal: Integer;
    var
      WindowList: Pointer;
      SaveFocusCount: Integer;
      SaveCursor: TCursor;
      SaveCount: Integer;
      ActiveWindow: HWnd;
    begin
      CancelDrag;
      if Visible or not Enabled or (fsModal in FFormState) or
        (FormStyle = fsMDIChild) then
        raise EInvalidOperation.Create(SCannotShowModal);  
      //自己看看符合哪个条件就是了
      ...
    end;
      

  4.   

    form:=form.create(application);
    form.showmodal;