請問關於置頂功能
詢問, 若一個 GUI 程序運行中, 如何當勾選一個 checkbox 元件時, 就能讓自身程序置頂 ? 當取消勾選時程式窗口就不會變成置頂狀態[ 本帖最后由 abiteric 于 2008-6-4 20:28 编辑 ] 稍作修改即可....
#include <GUIConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 193, 72, 193, 125)
$Checkbox1 = GUICtrlCreateCheckbox("置顶/不置顶", 32, 16, 129, 33)
GUISetState(@SW_SHOW)
Run("Calc.exe")
#EndRegion ### END Koda GUI section ###
Global $I = 1
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Checkbox1
If $I = 1 Then
WinSetOnTop ("计算器", "", 1)
$I = 0
Else
WinSetOnTop ("计算器", "", 0)
$I = 1
EndIf
EndSwitch
WEnd #include <GUIConstantsex.au3>
$mainwindow = GUICreate('testtest')
$cbox=GUICtrlCreateCheckbox ( "on top", 50, 100 )
GUISetState()
do
if GUICtrlRead ( $cbox )= $GUI_CHECKED then
WinSetOnTop ( "testtest", "", 1 )
else
WinSetOnTop ( "testtest", "", 0 )
endif
until guigetmsg()=$GUI_event_close 感謝樓上二位~ 解決!
页:
[1]