Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

need help on initalizing input ctrl automatically

$
0
0
hello, guys i got problem on getting input control to initial state, 
i need inputting number from 1- 256 to input control as conditions,then my app can do something, is there a way can automatically update input control to initial state without pressing backspace key when i input next number, i have worked around on this a couple hours with failure,  
Any help will be appreciated, lhw
 
my codes like below
 
AutoIt         
#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> $GUI = GUICreate("Input Test", 278, 215) $cInput = GUICtrlCreateInput("", 24, 16, 60, 30, $ES_NUMBER) GUICtrlSetLimit(-1, 3, 1) $Button = GUICtrlCreateButton("Button", 192, 152, 73, 33, $BS_DEFPUSHBUTTON) $lab= GUICtrlCreateLabel("", 16, 80, 161, 105) GUICtrlSetBkColor(-1, 0XFFFFFF) GUICtrlSetData(-1, "") GUISetState(@SW_SHOW) While 1     $nMsg = GUIGetMsg()     Switch $nMsg         Case $GUI_EVENT_CLOSE             Exit                 Case $Button                      $DATA = GUICtrlRead($CInput)               If $DATA >= 1 And $DATA <= 256 Then             ;do something             GUICtrlSetData($LAB, $DATA)                              Else             GUICtrlSetData($CInput, '')             MsgBox(0, 0, 'invalid input')              EndIf     EndSwitch WEnd
 

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>