Jump to content

GUI keeps closing without interaction


Recommended Posts

Why is it closing with out hitting the Finish button?

#include <Array.au3>
#include <File.au3>
#include <GuiConstantsEx.au3>
#include <Misc.au3>
#Include <GuiButton.au3>

_Singleton("CreateUser")

; #########################################################################################
; # Create GUI
; #########################################################################################

GUICreate("Account Creation", 300, 300)


; PROGRESS

$progress = 0

;$progressbar = GUICtrlCreateProgress(10, 10, 200, 20)
$progressbar = GuiCtrlCreateProgress(60, 80, 150, 20)
GuiCtrlSetData($progressbar, $progress)
$label = GuiCtrlCreateLabel("Progress:", 5, 82)
$userList = GUICtrlCreateList("", 176, 32, 121, 97)
$finishedButton = GUICtrlCreateButton("Finished", 70,50,60)
GuiSetState(@SW_SHOW)

; #########################################################################################
; # GUI Event
; #########################################################################################

Opt("GUIOnEventMode",1)
GUISetOnEvent ($GUI_EVENT_CLOSE, "Closed")
GUISetOnEvent ($finishedButton, "Finished")

Func Closed()
    Exit
EndFunc

Func Finished()
    MsgBox (4096, "test", "you clicked Finish")
       Exit
EndFunc


; #########################################################################################
; # Progress Bar
; #########################################################################################

$UserName = ("Tester")
$Password = ("Password")

$progress = $progress + 10
GuiCtrlSetData($progressbar, $progress)
Link to comment
Share on other sites

  • Developers

Where are you making sure that the program keeps running?

Looks to me it ends after having executed the last line.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers

c'mon :P

Just check the zillion examples

While 1
   sleep(50)
Wend
Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...