E1M1 Posted October 18, 2009 Posted October 18, 2009 (edited) How I can edit Slider's value by editing input1? I want also update input 1 value in real time while I move slider 1. But if I click on input 1 I cant type new value there. How can I stop input1 updating while I am typing in input1? and if i click on slider 1 i want start updating input1 again. $Form1 = GUICreate("Settings", 316, 333, 192, 124) $Slider1 = GUICtrlCreateSlider(16, 248, 286, 45,BitOR($TBS_TOOLTIPS, $TBS_AUTOTICKS)) GUICtrlSetLimit(-1, 1000, 0) GUICtrlSetData(-1,10) $input1 = GUICtrlCreateInput(10, 88, 216, 49, 21) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() GUICtrlSetData($input1,GUICtrlRead($Slider1)) Switch $nMsg Case $GUI_EVENT_CLOSE GUIDelete() ExitLoop Case $input1 $active = 1 Exit EndSwitch WEnd Edited October 18, 2009 by E1M1 edited
Moderators Melba23 Posted October 18, 2009 Moderators Posted October 18, 2009 E1M1,This should do what you asked for. Press {Enter} when you have edited the Input:expandcollapse popup#include <GUIConstantsEx.au3> #include <SliderConstants.au3> #include <Misc.au3> #include <WinAPI.au3> $Form1 = GUICreate("Settings", 316, 333, 192, 124) $Slider1 = GUICtrlCreateSlider(16, 248, 286, 45, BitOR($TBS_TOOLTIPS, $TBS_AUTOTICKS)) GUICtrlSetLimit(-1, 1000, 0) GUICtrlSetData(-1, 10) $input1 = GUICtrlCreateInput(10, 88, 216, 49, 21) $hButton = GUICtrlCreateButton("", -10, 10, 1, 1) GUICtrlSetState(-1, $GUI_FOCUS) GUISetState(@SW_SHOW) While 1 If _WinAPI_GetFocus() = ControlGetHandle($Form1, "", $input1) Then _Manual() Else GUICtrlSetData($input1, GUICtrlRead($Slider1)) EndIf Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func _Manual() $dll = DllOpen("user32.dll") Do Sleep(10) Until _IsPressed("0D", $dll) DllClose($dll) ConsoleWrite("Here 3" & @CRLF) GUICtrlSetData($Slider1, GUICtrlRead($input1)) GUICtrlSetState($hButton, $GUI_FOCUS) EndFuncM23 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
E1M1 Posted October 18, 2009 Author Posted October 18, 2009 yes but how to make it cange value w/o enter? i want change it everytime I type number (every time 1 of controls change 2nd must change too) edited
Moderators Melba23 Posted October 18, 2009 Moderators Posted October 18, 2009 E1M1, You want fries with that? Func _Manual() GUICtrlSetData($Slider1, GUICtrlRead($input1)) EndFunc M23 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
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