如form2是自动创建的话:Form2.Show or Form2.ShowModal.

解决方案 »

  1.   

    procedure FromShow(frm:TForm);
    begin
      frm.show;
    end;
      

  2.   

    给你两个好用的函数:
    {sc----------------------------------------------------------------------- 
               +++++显示窗体函数:供内部调用。可使窗体只Create一次+++++ 
                            -----参数说明: 
                                 FormClass:窗体名 
                                Caption: 窗体标题 
                               Restore:显示为原来大小。 
    -----------------------------------------------------------------------sc} 
     
    function InternalFindShowForm(FormClass: TFormClass; 
      const Caption: string; Restore: Boolean): TForm; 
    var 
      I: Integer; 
    begin 
      Result := nil; 
      for I := 0 to Screen.FormCount - 1 do begin 
        if Screen.Forms[I] is FormClass then 
          if (Caption = '') or (Caption = Screen.Forms[I].Caption) then begin 
            Result := Screen.Forms[I]; 
            Break; 
          end; 
      end; 
      if Result = nil then begin 
        Application.CreateForm(FormClass, Result); 
        if Caption <> '' then Result.Caption := Caption; 
      end; 
      with Result do begin 
        if Restore and (WindowState = wsMinimized) then WindowState := wsNormal; 
        Show; 
      end; 
    end;function ShowDialog(FormClass: TFormClass): Boolean;
    var
      Dlg: TForm;
    begin
      Application.CreateForm(FormClass, Dlg);
      try
        Result := Dlg.ShowModal in [mrOk, mrYes];
      finally
        Dlg.Free;
      end;
    end;