代替showmodal其他两种方法

类别:Delphi 点击:0 评论:0 推荐:

procedure TForm1.Button1Click(Sender: TObject);
begin
enablewindow(handle,false);//窗口一不可用
form2.show;

end;
procedure TForm2.FormClose(Sender: TObject; var Action: TCloseAction);
begin
enablewindow(form1.handle,true);//可用
end;

或者
var
  Form1: TForm1;
  WindowList: Pointer;


implementation

uses Unit2;

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);
begin
  WindowList:= DisableTaskWindows(self.handle);
  form2.show;

end;

uses Unit1;

{$R *.DFM}

procedure TForm2.FormClose(Sender: TObject; var Action: TCloseAction);
begin
     EnableTaskWindows(unit1.WindowList);
end;

 

本文地址:http://com.8s8s.com/it/it6101.htm