小 小小鸟!!! Unregistered / Unconfirmed GUEST, unregistred user! 2003-12-25 #1 哪位大侠能告诉我一个小问题 我想建两个窗体Frm1和Frm2,让Frm1永远在Frm2的上面,包括对Frm2进行操作的时侯。
M mystudy Unregistered / Unconfirmed GUEST, unregistred user! 2003-12-25 #3 设置fromstyle的属性为fsStayOnTop
D DouZheng Unregistered / Unconfirmed GUEST, unregistred user! 2003-12-25 #4 让Frm1 的 FormStyle 设成 fsStayOnTop :P
C cheylin Unregistered / Unconfirmed GUEST, unregistred user! 2003-12-25 #5 除了让Frm1 的 FormStyle 设成 fsStayOnTop 之外,还要保证Frm2的FormStyle 不能设成 fsStayOnTop
A app2001 Unregistered / Unconfirmed GUEST, unregistred user! 2003-12-25 #7 在frm1中拦截一个信息 private { Private declarations } public { Public declarations } procedure Createparams(var Params: TCreateParams); override; //在最前面 end; procedure TForm1.Createparams(var Params: TCreateParams); begin inherited CreateParams(Params); with Paramsdo begin EXStyle := ExStyle or WS_EX_TOPMOST or WS_EX_ACCEPTFILES ; //or WS_DLGFRAME wndParent := GetDesktopWindow; //关键一行,用SetParent都不行!! end; end;
在frm1中拦截一个信息 private { Private declarations } public { Public declarations } procedure Createparams(var Params: TCreateParams); override; //在最前面 end; procedure TForm1.Createparams(var Params: TCreateParams); begin inherited CreateParams(Params); with Paramsdo begin EXStyle := ExStyle or WS_EX_TOPMOST or WS_EX_ACCEPTFILES ; //or WS_DLGFRAME wndParent := GetDesktopWindow; //关键一行,用SetParent都不行!! end; end;
X xuxiaohan Unregistered / Unconfirmed GUEST, unregistred user! 2003-12-25 #8 将 windows.setparent(Frm1.handle,frm2.handle); 在里面,不是在上面,要不?
Y ysai Unregistered / Unconfirmed GUEST, unregistred user! 2003-12-25 #9 TForm1 = Class(TForm) public procedure Createparams(var Params: TCreateParams); override; end; procedure TForm1.CreateParams(var Params: TCreateParams); begin inherited CreateParams(Params); Params.wndParent := Form2.Handle;//FORM1永远在FORM2上 end;
TForm1 = Class(TForm) public procedure Createparams(var Params: TCreateParams); override; end; procedure TForm1.CreateParams(var Params: TCreateParams); begin inherited CreateParams(Params); Params.wndParent := Form2.Handle;//FORM1永远在FORM2上 end;