Jump to content
Sign in to follow this  

How to have 2 Forms

Recommended Posts


I am new at the creating GUIs this is my first projet with it. I am not sure how to creat 2 different forms and have them show up one after another like a Install shield would with the Next buttons and Finish and what not. Here is the Code I have so Far. I want to take out the first MSG Box ($Install) and replace it with a form if I can and also the second MSGBox ($Back).

Func _FileCopy($fromFile,$tofile, $fc_flag=272)
    $winShell = ObjCreate("shell.application")
$Install = MsgBox (0, "Update", "This Program Will Update Active Control to the Newest Version Please Click OK to Install")
If $Install = 1 Then
; These Are for Version Control Later on in the Development of the program
;   _FileCopy("C:\program files\activecontrol\1.txt", "C:\program files\activecontrol\Backup\")
;   _FileCopy("C:\program files\activecontrol\ActiveControl.mdb", "C:\program files\activecontrol\Backup\")
;   _FileCopy("C:\program files\activecontrol\Control.ico", "C:\program files\activecontrol\Backup\")
;   _FileCopy("C:\program files\activecontrol\Security.mdw", "C:\program files\activecontrol\Backup\")  
    _FileCopy("\\\Activecontrol\current\1.txt", "C:\program files\activecontrol\")
                _FileCopy("\\\Activecontrol\current\ActiveControl.mdb", "C:\program files\activecontrol\")
    _FileCopy("\\\Activecontrol\current\Control.ico", "C:\program files\activecontrol\")
    _FileCopy("\\\Activecontrol\current\Security.mdw", "C:\program files\activecontrol\")
#include <GuiConstants.au3>

$Form1 = GuiCreate("Finished", 258, 210,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))
GUISetIcon ("c:\Program files\ActiveControl\control.ico")
Opt ("GuiCloseOnESC", 0)
$Button_1 = GuiCtrlCreateButton("< Back", 96, 176, 65, 25, 0)
GUICtrlSetState (-1, $GUI_DISABLE)
$Button_2 = GuiCtrlCreateButton("Finish", 184, 176, 65, 25, 0)
GuiCtrlSetstate (-1, $GUI_Focus)
$Button_3 = GuiCtrlCreateButton("Cancel", 8, 176, 65, 25, 0)
GUICtrlSetState (-1, $GUI_DISABLE)
$Input_4 = GUICtrlCreateLabel("The Newest Version of Active Control is now Installed Please Click Finish.", 10, 31, 236, 55,$ES_Center)
$Group_5 = GuiCtrlCreateGroup("Install Finished", 8, 8, 241, 161)
While 1
    $msg = GuiGetMsg()
        Case $msg = $GUI_EVENT_CLOSE
    Case $msg = $Button_2
    Case $msg = $Button_1
        $Back = MsgBox (52, "Rollback", "Are You Sure That You Want to Remove the Most Recent Version of Active Control and Install the Older Version Back On?")
        If $Back = 6 Then
        _FileCopy("C:\program files\activecontrol\Backup\1.txt", "C:\program files\activecontrol\")
        _FileCopy("C:\program files\activecontrol\Backup\ActiveControl.mdb", "C:\program files\activecontrol\")
        _FileCopy("C:\program files\activecontrol\Backup\Control.ico", "C:\program files\activecontrol\")
        _FileCopy("C:\program files\activecontrol\Backup\Security.mdw", "C:\program files\activecontrol\")  
    Case Else

Share this post

Link to post
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
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.