trescon Posted August 20, 2015 Posted August 20, 2015 Good morning, I have a question for experts.When I go to a sub form, withCase $GUI_EVENT_CLOSE GUIDelete ($Form2) ExitLoopto return to the main form the variables that I acquired withGUICtrlCreateInputGUICtrlCreateComboThey are automatically reset or is their content?Thank you Thank You Alberto --------------------------------------------------- I am translate with Google.
Moderators Melba23 Posted August 20, 2015 Moderators Posted August 20, 2015 trescon,The variables will stll hold the ControlIds of the now-deleted controls - and these ControlIDs will be reused if you create further controls as they are just integer indices to an internal AutoIt array which keeps track of native created controls. So you need to be very careful NOT to reuse those variables (unless they have been reassigned) as the ControlIDs they hold may well not apply to the controls you think they do.Please ask if you have any further questions.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
trescon Posted August 20, 2015 Author Posted August 20, 2015 Thanks Melba23.Now I would have another question to ask.Let's pretend we have a GUI with several input, some others are only GUICtrlCreateInput and GUICtrlCreateCombo.We say now that I have populated all fields, and except I have to reset the interface fields for the next entry.If I make a Sub where I reset all variabilie (ex. $Color = "") and then return to the GUI to populate the fields I am the GUI is cleared, but I find it empty all our curtains COMBO.How can I do then to do a refresh of the screen without ruining it. Thank You Alberto --------------------------------------------------- I am translate with Google.
Moderators Melba23 Posted August 20, 2015 Moderators Posted August 20, 2015 trescon,As clear as mud. But peering into the murk, is this what you want to know?expandcollapse popup#include <GUIConstantsEx.au3> $sComboData = "|1|2|3|4|5" ; Note leading "|" to replace existing data $hGUI = GUICreate("Test", 500, 500) $cInput = GUICtrlCreateInput("", 10, 10, 200, 20) $cCombo = GUICtrlCreateCombo("", 10, 100, 200, 20) GUICtrlSetData($cCombo, $sComboData) GUICtrlCreateLabel("Add something to the input and select something in the combo", 10, 200, 480, 20) $cClear = GUICtrlCreateButton("Clear controls", 10, 300, 120, 30) GUICtrlSetState($cClear, $GUI_DISABLE) GUISetState() $bFilled = False While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $cClear GUICtrlSetData($cInput, "") ; Clear the input GUICtrlSetData($cCombo, $sComboData) ; Clear the combo by reloading it $bFilled = False GUICtrlSetState($cClear, $GUI_DISABLE) EndSwitch If GUICtrlRead($cInput) And GUICtrlRead($cCombo) And Not $bFilled Then $bFilled = True GUICtrlSetState($cClear, $GUI_ENABLE) EndIf WEndM23 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
trescon Posted August 20, 2015 Author Posted August 20, 2015 Thanks Melba23.The practice I associate the choices of the combo to a variable and when I want to reset the gui I rebind the variable combo.Simple and obvious, for who knows.From this you can understand that I am a beginner.Thank youAgain Thank You Alberto --------------------------------------------------- I am translate with Google.
Moderators Melba23 Posted August 20, 2015 Moderators Posted August 20, 2015 trescon,Glad the crystal ball was working!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
trescon Posted August 24, 2015 Author Posted August 24, 2015 Hello Melba23, I did as you suggested.The only difference is that the allocation and zeroing of the combos I've included in a Func called by a Call.I have the problem that after the zeroing and the return to the insertion, the number of references of the combo doubles zero (in practice appear twice in a row reference numbers, and are also selectable).In more 'when I reset the input field remains the combo with the last previous selection (not empty as startup progam).Zeroing is because all of the input variables are reset.Where am I wrong ??Thank youAlberto---------------Ita : Salve Melba23, ho fatto come mi hai suggerito.L'unica differenza è che l'assegnazione e l'azzeramento delle combo io le ho inserite in un Func richiamata da una Call.Ho il problema che dopo l'azzeramento e il ritorno all'inserimento, il numero di referenze della combo azzerata raddoppia (in pratica vengono visualizzate due volte di fila le referenze , e risultano pure selezionabili).In piu' quando azzero, il campo input della combo resta con l'ultima selezione precedente (non vuoto come all'avvio del progamma).L'azzeramento avviene perchè tutte le variabili delle input si resettano.Dove sbaglio ??Grazie Thank You Alberto --------------------------------------------------- I am translate with Google.
trescon Posted August 24, 2015 Author Posted August 24, 2015 $Marca = GUICtrlCreateCombo("", 40, 50, 130, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL))GUICtrlSetData($Marca, $MarcaDati)Reset :GUICtrlSetData($Marca,"")GUICtrlSetData($Marca,$MarcaDati) I think I understand.I must not only re-sell combo but I also have to clear the variable GUICtrlCreateCombo.Right?Alberto Thank You Alberto --------------------------------------------------- I am translate with Google.
Moderators Melba23 Posted August 24, 2015 Moderators Posted August 24, 2015 trescon,the number of references of the combo doubles zero (in practice appear twice in a row reference numbersDid you notice this comment in the example I posted: $sComboData = "|1|2|3|4|5" ; Note leading "|" to replace existing dataIf you do not have the leading "|" then you just add to the existing data - which I what I understand you to be saying.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