Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Problem, GuiDelete (?)

$
0
0
AutoIt         
#include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <GUIListBox.au3> #include <WindowsConstants.au3> Global $GUI = GUICreate("Kulinarne przepisy", 293, 294, 302, 218) Global $Przepisy = GUICtrlCreateList("xd", 0, 0, 153, 292) $Skasuj = GUICtrlCreateButton("Skasuj", 160, 146, 129, 49) $Dodaj = GUICtrlCreateButton("Dodaj", 160, 90, 129, 49) GUISetState(@SW_SHOW) While 1     $nMsg = GUIGetMsg()     Switch $nMsg         Case $GUI_EVENT_CLOSE             Exit         Case $Dodaj             Dodaj()         Case $Skasuj         If Not GUICtrlRead($Przepisy) = "" Then             $DoSkasownia = _GUICtrlListBox_FindInText($Przepisy, GUICtrlRead($Przepisy))             _GUICtrlListBox_DeleteString($Przepisy, $DoSkasownia)         EndIf     EndSwitch WEnd Func Dodaj() Local $GuiDodaj = GUICreate("Dodawanie przepisu", 267, 357, 192, 124) GUICtrlCreateLabel("Podaj nazwę przepisu:", 64, 8, 139, 22) GUICtrlSetFont(-1, 10, 400, 0, "Comic Sans MS") $Nazwa = GUICtrlCreateInput("", 0, 32, 265, 21) GUICtrlCreateLabel("Tutaj daj przepis:", 72, 64, 113, 22) GUICtrlSetFont(-1, 10, 400, 0, "Comic Sans MS") $Przepis = GUICtrlCreateEdit("", 0, 88, 265, 225) GUICtrlSetData(-1, "Przepis") $Dodaj = GUICtrlCreateButton("Dodaj!", 49, 320, 169, 33) GUISetState(@SW_SHOW) While 1     $nMsg = GUIGetMsg()     Switch $nMsg         Case $GUI_EVENT_CLOSE             GUIDelete($GuiDodaj)             Return         Case $Dodaj             GUICtrlSetData($Przepisy, GUICtrlRead($Nazwa) & "|")             GUIDelete($GuiDodaj)             Return     EndSwitch WEnd EndFunc

I have problem, function dodaj() - Works.

 

But only once, when I want to re-use function "dodaj" it does not work anymore, what's the problem?

 

@edit

 

Fixed, must rename button ;x


Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>