Verssuss Posted November 8, 2022 Share Posted November 8, 2022 can i use case to detect GUICtrlCreateUpDown(-1) if was click up or down button ? $_wait_input = GUICtrlCreateInput("2000", 730, 40, 74, 20) $_wait_X = GUICtrlCreateUpDown($_wait_input) Switch GUIGetMsg() Case $_wait_X If $_wait_X = True Then ConsoleWrite("$_wait_X 1" & @CRLF) Else ;~ If $_wait_X = False Then ConsoleWrite("$_wait_X 2" & @CRLF) EndIf or my destiny is input with updown when value its <1 its beacome decimal mean if u have value 2 and click down u have 1 but if u have 1 and click down it go 0.9 up to 0 if i know how detect up or down was clicked i can try continue or i made 2 buttons looks like updown control ?? Link to comment Share on other sites More sharing options...
Developers Jos Posted November 8, 2022 Developers Share Posted November 8, 2022 just read the value with: $ival=GUICtrlRead($_wait_input). Like shown in the helpfile example. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Nine Posted November 8, 2022 Share Posted November 8, 2022 You can use a quicker approach where you keep previous value and compare with new value. I personally prefer a more "elegant" solution using WM_NOTIFY. Following both ways in same example : expandcollapse popup#include <GUIConstants.au3> #include <Constants.au3> #include <StructureConstants.au3> Global Const $UDN_DELTAPOS = -722 Global Const $tagNMUPDOWN = $tagNMHDR & ";int iPos;int iDelta" Global $hUpDown Example() Func Example() GUICreate("My GUI UpDown", -1, -1, -1, -1, $WS_SIZEBOX) Local $iStart = 2 Local $idInput = GUICtrlCreateInput($iStart, 10, 10, 100, 20) Local $idUpDown = GUICtrlCreateUpdown($idInput) $hUpDown = GUICtrlGetHandle($idUpDown) GUIRegisterMsg($WM_NOTIFY, WM_NOTIFY) GUISetState() While True Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $idUpDown ConsoleWrite(GUICtrlRead($idInput) - $iStart & @CRLF) $iStart = GUICtrlRead($idInput) EndSwitch WEnd EndFunc ;==>Example Func WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam) Local $tNMHDR = DllStructCreate($tagNMHDR, $lParam), $tNMUPDOWN If $tNMHDR.hWndFrom = $hUpDown And $tNMHDR.Code = $UDN_DELTAPOS Then $tNMUPDOWN = DllStructCreate($tagNMUPDOWN, $lParam) ConsoleWrite($tNMUPDOWN.iPos & "/" & $tNMUPDOWN.iDelta & @CRLF) EndIf Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY Verssuss 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 8, 2022 Moderators Share Posted November 8, 2022 Verssuss, And just for fun, a dummy updown: #include <GUIConstantsEx.au3> $hGUI = GUICreate("Test", 500, 500) $cInput = GUICtrlCreateInput(1, 10, 10, 50, 20) $cDummyInput = GUICtrlCreateInput(10, 75, 10, 1, 20) $cUpDown = GUICtrlCreateUpdown($cDummyInput) GUICtrlSetLimit($cUpDown, 19, 0) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $cDummyInput _SetData() EndSwitch WEnd Func _SetData() Local $iDummy = Number(GUICtrlRead($cDummyInput)) If $iDummy >= 10 Then GUICtrlSetData($cInput, $iDummy - 9) Else GUICtrlSetData($cInput, "." & $iDummy) EndIf M23 Verssuss 1 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Verssuss Posted November 8, 2022 Author Share Posted November 8, 2022 3 hours ago, Jos said: just read the value with: $ival=GUICtrlRead($_wait_input). Like shown in the helpfile example. it just read value of input i want detect if up or down was used $_wait_input = GUICtrlCreateInput("2000", 730, 40, 74, 20) $_wait_X = GUICtrlCreateUpDown($_wait_input) Case $_wait_X $iva1=GUICtrlRead($_wait_input) $iva2=GUICtrlRead($_wait_X) ConsoleWrite("1: " & $ival & "/2: "& $iva2 & @CRLF) wm_notify need read so many data to do simple thing thx melba for best suggestion u just missed 0 before . here is full what i need expandcollapse popup#include <GUIConstantsEx.au3> $hGUI = GUICreate("Test", 500, 500) $cDummyInput = GUICtrlCreateInput(1, 10, 50, 50, 30) GUICtrlCreateUpdown(-1) GUISetState() Local $max = False While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $cDummyInput _SetData() EndSwitch WEnd Func _SetData() If GUICtrlRead($cDummyInput) = 0 and $max = False Then GUICtrlSetData($cDummyInput, "0.9") EndIf If GUICtrlRead($cDummyInput) = -1 and $max = False Then GUICtrlSetData($cDummyInput, "0.8") EndIf If GUICtrlRead($cDummyInput) = -2 and $max = False Then GUICtrlSetData($cDummyInput, "0.7") EndIf If GUICtrlRead($cDummyInput) = -3 and $max = False Then GUICtrlSetData($cDummyInput, "0.6") EndIf If GUICtrlRead($cDummyInput) = -4 and $max = False Then GUICtrlSetData($cDummyInput, "0.5") EndIf If GUICtrlRead($cDummyInput) = -5 and $max = False Then GUICtrlSetData($cDummyInput, "0.4") EndIf If GUICtrlRead($cDummyInput) = -6 and $max = False Then GUICtrlSetData($cDummyInput, "0.3") EndIf If GUICtrlRead($cDummyInput) = -7 and $max = False Then GUICtrlSetData($cDummyInput, "0.2") EndIf If GUICtrlRead($cDummyInput) = -8 and $max = False Then GUICtrlSetData($cDummyInput, "0.1") EndIf If GUICtrlRead($cDummyInput) = -9 and $max = False Then $max = True GUICtrlSetData($cDummyInput, "0") EndIf If GUICtrlRead($cDummyInput) > 0 Then $max = False EndIf If GUICtrlRead($cDummyInput) < 0 Then GUICtrlSetData($cDummyInput, "0") EndIf EndFunc now just insert here right For loop but cant find now Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now