GUI - show, submit and recall Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Peter2
Posts: 325
Joined: 21 Sep 2014, 14:38
Location: CH

GUI - show, submit and recall

18 Jun 2019, 08:34

I have a (maybe stupid) mistake in my code-structure. The simple idea is

- show a GUI-dialogue
- press a button
- GUI disappears, something is done
- GUI should be displayed again
-->> And here I get the message that a variable cannot be defined twice ...

What's wrong? Here is the structure of the code

Code: Select all

#SingleInstance Force
#NoEnv
SetWorkingDir %A_ScriptDir%
SetBatchLines -1
Gosub, Fensteraufbau
return  ; Ende Hauptprogramm

;; *************************************
Fensteraufbau:
Gui Add, Text,      x200    y20     w120 h23 +Disabled +0x200,   Wasser
....
Gui Add, Button,    x30     y450    w100 h23 gStarten, &Starten
Gui Add, Button,    x150    y450    w100 h23 gLogzeigen, &Log anzeigen
Gui Add, Button,    x270    y450    w100 h23 gBeenden, &Beenden

Gui, Color, EBF4FA
Gui Show, w430 h500, 1-Klick
Return
;; *************************************
Logzeigen:
    Run, %A_ScriptDir%\Gesamtlog.log
return
;; *************************************
Starten:
...
    Gui,Submit
        If gawa=1
        {
            Gosub, Wartungslauf
        }
Gosub, Fensteraufbau
return
;; *************************************
Wartungslauf:
....do something
return
;; *************************************
GuiEscape:
GuiClose:
Beenden:
    ExitApp
return
Peter (AHK Beginner) / Win 10 x64, AHK Version v1.1.33
just me
Posts: 9459
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: GUI - show, submit and recall  Topic is solved

18 Jun 2019, 08:46

  • Create the GUI only once.
  • Use GuiControl to (re)set the controls.
  • Use Gui, Show, ... to (re)show the GUI.
Peter2
Posts: 325
Joined: 21 Sep 2014, 14:38
Location: CH

Re: GUI - show, submit and recall

18 Jun 2019, 08:50

Incredible speed of solution!

Thanks to both :bravo: :beer:
Peter (AHK Beginner) / Win 10 x64, AHK Version v1.1.33

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Araphen, Google [Bot], Oblomov228 and 165 guests