CyBoRgWaR Posted January 28, 2017 Posted January 28, 2017 Hi , Need help in Clearing value of a particular Input box , then reset to default value of the input box during button clicks. $Inputbox1 = GUICtrlCreateInput("test", 64, 280, 57, 21); where i have created Case $msg = $Button4 ; Task Disable ; mapped to button 4 GUISetState() GUICtrlSetState($Radio7, $GUI_DISABLE) ; this works fine GUICtrlSetState($Radio7, $GUI_UNCHECKED);this works fine GUICtrlSetState($inputbox1,$GUI_DISABLE) ;this works fine GUICtrlSetState($inputbox 1,Default) ; unable to clear the last entered value to default value (test) Please help me out guys,
Moderators Melba23 Posted January 28, 2017 Moderators Posted January 28, 2017 CyBoRgWaR, You need GUICtrlSetData to set the content of the input. 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
CyBoRgWaR Posted January 28, 2017 Author Posted January 28, 2017 GUICtrlSetData($input box1 , default ) which clears the value and set it as "default" rather "test" you mean to say i need to enter the value "test " again ? on the place of default?
CyBoRgWaR Posted January 28, 2017 Author Posted January 28, 2017 if i do so like GUICtrlSetData($inputbox1,"test") then when ever i click the box its not clearing the inputbox rather it adds testtesttest and so on...
Moderators Melba23 Posted January 28, 2017 Moderators Posted January 28, 2017 CyBoRgWaR, Indeed you need to define the content - how do you expect AutoIt to know what you set as the original value? And this works fine for me: #include <GUIConstantsEx.au3> $hGUI = GUICreate("Test", 500, 500) $Inputbox1 = GUICtrlCreateInput("test", 64, 280, 57, 21) $Button4 = GUICtrlCreateButton("Reset", 10, 450, 80, 30) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $Button4 GUICtrlSetState($inputbox1,$GUI_DISABLE) GUICtrlSetData($inputbox1, "test") EndSwitch WEnd You might be interested in _GUICtrlEdit_SetCueBanner - that does automatically reset when the control is emptied. M23 CyBoRgWaR 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
CyBoRgWaR Posted January 28, 2017 Author Posted January 28, 2017 Works like charm .... Thanks for your time and Help Bro ,
CyBoRgWaR Posted January 28, 2017 Author Posted January 28, 2017 also one more help , i have a group of inputbox, on one click all the inputbox need to be reset , so i need to make one by one or a single command can be done ?? example: expandcollapse popup#include <GUIConstantsEx.au3> $hGUI = GUICreate("Test", 500, 500) $Inputbox1 = GUICtrlCreateInput("test", 64, 280, 57, 21) $Button4 = GUICtrlCreateButton("Reset", 10, 450, 80, 30) $Button3 = GUICtrlCreateButton("enable", 100, 450, 80, 30) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $Button4 GUICtrlSetState($inputbox1,$GUI_DISABLE) GUICtrlSetState($inputbox2,$GUI_DISABLE) ;. ;. ;. ;. ;. ;. GUICtrlSetState($inputbox99,$GUI_DISABLE) GUICtrlSetData($inputbox1, "test") GUICtrlSetData($inputbox2, "test2") ;. ;. ;. ;. ;. ;. GUICtrlSetData($inputbox99, "test99") Case $Button3 GUICtrlSetState($inputbox1,$GUI_enable); for entering manual values GUICtrlSetState($inputbox2,$GUI_enable) ;. ;. ;. ;. ;. ;. GUICtrlSetState($inputbox99,$GUI_enable) EndSwitch WEnd Is that any way i can do all at once without this bulk coding ??
Moderators Melba23 Posted January 28, 2017 Moderators Posted January 28, 2017 CyBoRgWaR, Put the ControlIDs of the Inputs into an array and then loop through it like this: #include <GUIConstantsEx.au3> Global $aInput_CID[5] $hGUI = GUICreate("Test", 500, 500) For $i = 0 To UBound($aInput_CID) - 1 $aInput_CID[$i] = GUICtrlCreateInput("Test " & $i, 10, 10 + (30 * $i), 50, 20) Next $Button4 = GUICtrlCreateButton("Reset", 10, 450, 80, 30) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $Button4 For $i = 0 To UBound($aInput_CID) - 1 GUICtrlSetState($aInput_CID[$i], $GUI_DISABLE) GUICtrlSetData($aInput_CID[$i], "Test " & $i) Next EndSwitch WEnd M23 CyBoRgWaR 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
Moderators Melba23 Posted January 28, 2017 Moderators Posted January 28, 2017 CyBoRgWaR, My pleasure- as always. 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