本帖最后由 862228699 于 2021-11-5 17:59 编辑
Opt("GUIOnEventMode", 1)
Global $bText[2] = ['窗口置顶', '取消置顶']
Global $Form1 = GUICreate($bText[0], 200, 200)
GUISetOnEvent(-3, "CLOSE")
$eButton = GUICtrlCreateButton($bText[0], 20, 50, 150, 70)
GUICtrlSetOnEvent(-1, "click")
GUISetState(@SW_SHOW)
While Sleep(10)
WEnd
Func click()
WinSetOnTop($Form1, '', GUICtrlRead($eButton) = $bText[0])
GUICtrlSetData($eButton, GUICtrlRead($eButton) = $bText[0] ? $bText[1] : $bText[0])
EndFunc ;==>click
Func CLOSE()
Exit
EndFunc ;==>CLOSE
|