W
wanglong
Unregistered / Unconfirmed
GUEST, unregistred user!
我把form1设置成了fsStayOnTop,这是我的代码:只要点击button2,showmessage的那句话就会跑到form1窗体的后面去,不注意的人还以为死机了呢,我知道是fsStayOnTop和CreateParams的原因,但我又必须得用fsStayOnTop,CreateParams,showmessage,哪位高手能解决呢??<br>unit Unit1;<br><br>interface<br><br>uses<br> Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,<br> Dialogs, StdCtrls;<br><br>type<br> TForm1 = class(TForm)<br> Button2: TButton;<br> procedure Button2Click(Sender: TObject);<br> procedure CreateParams(var Params: TCreateParams); override;<br> private<br> { Private declarations }<br> public<br> { Public declarations }<br> end;<br><br>var<br> Form1: TForm1;<br><br>implementation<br><br>uses Unit2;<br><br>{$R *.dfm}<br><br>procedure TForm1.CreateParams(var Params: TCreateParams);<br>begin<br> inherited;<br> Params.WndParent := 0;<br>end;<br><br>procedure TForm1.Button2Click(Sender: TObject);<br>begin<br> showmessage('看看跑没跑后面去');<br>end;<br><br>end.