这个效果有时候可以有的。 来自 qdac官方群 群猪 swish 分享。Thanks!
unit Unit12; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm12 = class(TForm) btn1: TButton; btn2: TButton; procedure btn1Click(Sender: TObject); procedure btn2Click(Sender: TObject); procedure FormCreate(Sender: TObject); private { Private declarations } procedure DoModalStart(ASender:TObject); public { Public declarations } end; var Form12: TForm12; implementation uses unit13; {$R *.dfm} procedure TForm12.btn1Click(Sender: TObject); var F:TForm; begin Form13:=TForm13.Create(Application); Form13.Show; end; procedure TForm12.btn2Click(Sender: TObject); begin TForm.Create(Application).ShowModal; end; procedure TForm12.DoModalStart(ASender: TObject); begin Form13.Hide; PostMessage(Form13.Handle,WM_APP,0,0); end; procedure TForm12.FormCreate(Sender: TObject); begin Application.OnModalBegin:=DoModalStart; end; end.