领星动网编程开发之爆炸小宇宙

cnitblog.com/lxasp - - 有一种信念叫做编程
posts - 61, comments - 34, trackbacks - 0, articles - 0
Procedure ForceGadgetZOrder(gadget)
   ;/ Flip the gadget draw order and force
   ;/ the topmost gadget to recieve focus
   ;/ first for overlapping gadgets

   SetWindowLong_(GadgetID(gadget),#GWL_STYLE,GetWindowLong_(GadgetID(gadget),#GWL_STYLE)|#WS_CLIPSIBLINGS)
   SetWindowPos_(GadgetID(gadget),#HWND_TOP,0,0,0,0,#SWP_NOSIZE|#SWP_NOMOVE)
EndProcedure

OpenWindow(0,640,480,120,100,"")
CreateGadgetList(WindowID(0))
ForceGadgetZOrder(ButtonGadget(#PB_Any,10,10,70,50,"Bottom"))
ForceGadgetZOrder(ButtonGadget(#PB_Any,40,40,70,50,"Top"))

Repeat
Until WaitWindowEvent()=#PB_Event_CloseWindow

Feedback

# re: 解决PureBasic的窗口控件的ZOrder问题  回复  更多评论   

2010-01-28 00:10 by 何乾
很有用的源码,谢谢。

希望能和你一起学习PB
我的QQ是182359041
只有注册用户登录后才能发表评论。