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) GUICtrlSetData($Przepisy, "Skasuj Mnie|") $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") $Koniec = GUICtrlCreateButton("Dodaj!", 49, 320, 169, 33) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE GUIDelete($GuiDodaj) Return Case $Koniec GUICtrlSetData($Przepisy, GUICtrlRead($Nazwa) & "|") GUIDelete($GuiDodaj) Return EndSwitch WEnd EndFunc
How to do that when I click two times for a given position in the list, it will start the feature?