Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <ButtonConstants.au3>
- #include <EditConstants.au3>
- #include <GUIConstantsEx.au3>
- #include <WindowsConstants.au3>
- #include <WinAPI.au3>
- Dim $aItems[4] = ["", "Hi", "Wie gehts?", "Tschüss"]
- Dim $iOld = 0
- ;The UpClick and DownClick Events
- $hIems = GUICreate("Test", 259, 138, -1, -1)
- GUISetFont(12, 400, 0, "Arial")
- $Button1 = GUICtrlCreateButton("Button1", 16, 56, 64, 64)
- $Title = GUICtrlCreateInput("1", 16, 16, 233, 26)
- $Arrow = GUICtrlCreateUpdown($Title)
- GUICtrlSetLimit($Arrow, 3, 1)
- $Button2 = GUICtrlCreateButton("Button2", 96, 56, 64, 64)
- $Button3 = GUICtrlCreateButton("Button3", 176, 56, 64, 64)
- GUISetState(@SW_SHOW)
- GUIRegisterMsg($WM_COMMAND, "_MY_WM_COMMAND")
- While 1
- $nMsg = GUIGetMsg()
- Switch $nMsg
- Case -3
- Exit
- ;~ Case $Arrow
- EndSwitch
- WEnd
- Func _MY_WM_COMMAND($hWnd, $nMsg, $wParam, $lParam)
- $iValue = GUICtrlRead(BitAND($wParam, 0xFFFF), 1)
- If $iValue <> $iOld Then
- $Cmp = StringCompare($iValue, $iOld)
- If $Cmp > 0 Then
- GUICtrlSetData($Title, $aItems[$iValue])
- $iOld = $iValue
- Else
- GUICtrlSetData($Title, $aItems[$iValue])
- $iOld = $iValue
- EndIf
- EndIf
- EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement