您的位置:程序门 -> delphi -> windows sdk/api



setchildorder 的使用


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


setchildorder 的使用
发表于:2007-03-28 17:48:38 楼主
我想设置   image   和   panel   的显示顺序,可是panel一直在前面,查找发现setchildorder用来设置顺序,可是不管用,为什么?
发表于:2007-03-28 18:00:281楼 得分:0
我顶
发表于:2007-03-28 18:07:312楼 得分:0
timage继承自tgraphiccontrol,所以不能把timage显示在twincontrol的前面(tpanel继承自twincontrol)。
发表于:2007-03-28 18:11:163楼 得分:0
image没有句柄,是non-windowed控件,而panel是windowed控件,non-windowed控件总是在windowed控件后。设置了也没用。见delphi的帮助:

the   stacking   order   of   windowed   and   non-windowed   controls   cannot   be   mingled.   for   example,   if   you   put   a   memo,   a   windowed   control,   on   a   form,   and   then   put   a   label,   a   non-windowed   control,   on   top   of   it,   the   label   disappears   behind   the   memo.   windowed   controls   always   stack   on   top   of   non-windowed   controls.   in   this   example,   calling   the   setzorder   method   of   the   label   or   the   memo   has   no   effect,   the   label   always   remains   behind   the   memo.


如果要摆在panel前面,把image放在另一个panel上,然后设置这个panel的位置。


快速检索

最新资讯
热门点击