本帖最后由 kk_lee69 于 2015-3-17 23:08 编辑
如程序所 示 父窗口下 有 A B C 三个子窗口 如何使 A子窗口永远在
其他子窗口之下,即使被点击了 仍然在其他子窗口下
#include <GuiConstants.au3>
#include <WindowsConstants.au3>
#include <winapi.au3>
Opt("GUIOnEventMode", 1)
;Global Const $SC_CLOSE = 0xF060
Local $ChildForm[1] = [0], $ChildBtn[1] = [0]
$WinMain = GUICreate("Main", 1000,750,-1,-1, $WS_MAXIMIZEBOX + $WS_MINIMIZEBOX + $WS_SIZEBOX)
GUISetOnEvent($GUI_EVENT_CLOSE,"GUI_COMMAND")
GUISetState(@SW_SHOW, $WinMain)
$WinMainSub=GUICreate("A視窗", 300,300, 200, 200, BitOR($WS_CHILD, $WS_CAPTION),-1, $WinMain)
_WinAPI_SetParent($WinMainSub, $WinMain)
GUISetState(@SW_SHOW, $WinMainSub)
$WinMainSub2=GUICreate("B視窗", 300,300,300, 300,BitOR($WS_CHILD, $WS_CAPTION),-1, $WinMain)
_WinAPI_SetParent($WinMainSub2,$WinMain)
GUISetState(@SW_SHOW, $WinMainSub2)
$WinMainSub3=GUICreate("C視窗", 300,300,400, 400,BitOR($WS_CHILD, $WS_CAPTION),-1, $WinMain)
_WinAPI_SetParent($WinMainSub2,$WinMain)
GUISetState(@SW_SHOW, $WinMainSub3)
GUISetOnEvent($GUI_EVENT_CLOSE,"GUI_COMMAND")
While 1
Sleep(20)
WEnd
Func GUI_COMMAND()
Switch @GUI_CtrlId
Case $GUI_EVENT_CLOSE
Switch @GUI_WINHANDLE
Case $WinMain
Exit
Case Else
GUIDelete(@GUI_WINHANDLE)
EndSwitch
EndSwitch
EndFunc
有參考過
http://www.autoitx.com/forum.php ... D7%B2%E3&page=2
這篇 文章 裡面的方法 不適用在 父子窗口 |