数学建模社区-数学中国

标题: 将窗体总放在最前面! [打印本页]

作者: ilikenba    时间: 2004-4-28 23:07
标题: 将窗体总放在最前面!
<>void __fastcall TForm1::CreateParams(Controls::TCreateParams &amparams)- ^# z% _& ^" o7 c
{2 G6 u6 H# H  C. M
    TForm::CreateParams(Params);
( a1 Z. ~- S7 H# h8 ^7 ~7 x3 o" K    Params.WndParent=GetDesktopWindow();* [9 t. c  o6 t, G1 D" p
    Params.ExStyle|=WS_EX_TOPMOST|WS_EX_TOOLWINDOW;
, |! P5 f1 c( M! b+ s2 `0 ^' c}</P>2 P6 O" e: d. |  n8 Y- V6 C+ _+ K) {0 V; W
<>重载了窗体类的CreateParams函数!</P>
作者: dino    时间: 2004-5-6 12:57
FromStyle=fsStayOnTop;一样吗?
作者: ilikenba    时间: 2004-5-6 14:35
fsStayOnTop This form remains on top of the desktop and of other forms in the project,( ^* v8 e" a6 i
                except any others that also have FormStyle set to fsStayOnTop.: B$ O7 `; {: e$ i7 S9 S, b3 G/ E8 r
                If one fsStayOnTop form launches another,% T* g4 [8 x9 }: i6 ~3 @
                 neither form will consistently remain on top.& M6 L- l. q0 o; c
Note: It is not advisable to change FormStyle at runtime.
! _+ p4 |/ _0 l" X上面是帮助中说的,也就是说把窗体的FormStyle属性设为fsStayOnTop时,如果还有一个已经存在的且$ W) ]- g8 S# i6 W9 ~
FormStyle属性为fsStayOnTop的窗体,那么这个窗体就不能保持在上面,这与我们有时的需要是不符的,+ z) b$ P1 `) O! O( P5 o( ~
而最上面的方法解决了这个问题!
作者: kmustty    时间: 2004-5-13 15:30
<>我想用按钮控制在<b>窗体总放在最前面怎样做呢???</b></P>




欢迎光临 数学建模社区-数学中国 (http://www.madio.net/) Powered by Discuz! X2.5