Jump to content

GUIdelete


trescon
 Share

Recommended Posts

Good morning, I have a question for experts.

When I go to a sub form, with

Case $GUI_EVENT_CLOSE
            GUIDelete ($Form2)
            ExitLoop

to return to the main form the variables that I acquired with

GUICtrlCreateInput

GUICtrlCreateCombo

They are automatically reset or is their content?

Thank you

Thank You

Alberto

---------------------------------------------------

I am translate with Google.

Link to comment
Share on other sites

  • Moderators

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • Moderators

trescon,

As clear as mud. But peering into the murk, is this what you want to know?

#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

WEnd

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

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 you
Again

Thank You

Alberto

---------------------------------------------------

I am translate with Google.

Link to comment
Share on other sites

  • Moderators

trescon,

Glad the crystal ball was working!

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

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 you

Alberto

---------------

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.

Link to comment
Share on other sites

$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.

Link to comment
Share on other sites

  • Moderators

trescon,

the number of references of the combo doubles zero (in practice appear twice in a row reference numbers

Did you notice this comment in the example I posted: 

$sComboData = "|1|2|3|4|5" ; Note leading "|" to replace existing data

If you do not have the leading "|" then you just add to the existing data - which I what I understand you to be saying.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...