本帖最后由 yamakawa 于 2017-6-22 14:29 编辑
回复 1# joint #include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <WinAPI.au3>
Global $Input,$Updown,$progress
$Form1_1 = GUICreate("ReDate", 261, 308, 192, 114, -1, $WS_EX_ACCEPTFILES)
$Label1 = GUICtrlCreateLabel("压力范围1到500", 16, 8, 87, 17)
$Input = GUICtrlCreateInput("100",150,8,56,21, BitOR($ES_NUMBER, $ES_RIGHT))
GUICtrlSetLimit(-1,3)
$progress =GUICtrlCreateProgress(9,30,240)
GUICtrlSetData(-1,20)
$Updown = GUICtrlCreateUpdown($Input)
GUICtrlSetLimit(-1,500,1)
GUISetState(@SW_SHOW)
GUIRegisterMsg($WM_COMMAND, "WM_COMMAND")
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUIDelete()
Func WM_COMMAND($hWnd, $iMsg, $iwParam, $ilParam)
#forceref $hWnd, $iMsg
Local $hWndFrom, $iIDFrom, $iCode
If Not IsHWnd($Input) Then $hWndAnno = GUICtrlGetHandle($Input)
$hWndFrom = $ilParam
$iIDFrom = _WinAPI_LoWord($iwParam)
$iCode = _WinAPI_HiWord($iwParam)
Switch $hWndFrom
Case $GUI_EVENT_CLOSE
Exit
Case $hWndAnno, $Input
if $iCode=$EN_CHANGE Then
If GUICtrlRead($Input) >500 Then GUICtrlSetData($Input,500)
GUICtrlSetData($progress,GUICtrlRead($Input)/5)
EndIf
EndSwitch
EndFunc
这样么 |