Jump to content
Sign in to follow this  
biase

GUI not showing

Recommended Posts

biase

Don't really know what's wrong with this code. No error but the GUI don't want to show up.

Can someone show/explain to me what's wrong? I need to know the problem (or may be it's my mistake which i didn't realize) that causing it.

#include-once
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

;~ Setting Control
Global $GCSForm, $GMsSQL, $LCMSLogin, $ICMSLogin, $LCMSPassword, $ICMSPassword, $LCMSServer, $ICMSServer, $LCMSPort, $ICMSPort, $GMySQL, $LCMYLogin, $ICMYLogin, $LCMYPassword
Global $ICMYPassword, $LCMYServer, $ICMYServer, $LCMYPort, $ICMYPort, $GPath, $LCSLocal, $ICSLocal, $BCSLocalBrowse, $LCSRemote, $ICSRemote, $BCSRemoteBrowse, $BCSClose, $BCSApply

#Region ### START Koda GUI section ### Form=F:\MySoft\Factory\Portable AutoIt3 v3.3.6.1\Form Desinger\Forms\ST SQL Importer.kxf
$GMForm = GUICreate("ST SQL Importer", 627, 449, 289, 154)
$BClose = GUICtrlCreateButton("Close", 544, 416, 75, 25)
$BMinimize = GUICtrlCreateButton("Minimize", 464, 416, 75, 25)
$BPause = GUICtrlCreateButton("Pause", 88, 416, 75, 25)
$BStart = GUICtrlCreateButton("Start", 8, 416, 75, 25)
$BSetting = GUICtrlCreateButton("Setting", 168, 416, 75, 25)
$ELog = GUICtrlCreateEdit("", 8, 8, 609, 401, BitOR($ES_AUTOVSCROLL, $ES_READONLY, $ES_WANTRETURN, $WS_VSCROLL))
GUICtrlSetBkColor(-1, 0xFFFFFF)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

Func CSettingForm()
    #Region ### START Koda GUI section ### Form=F:\MySoft\Factory\Portable AutoIt3 v3.3.6.1\Form Desinger\Forms\ST SQL Importer -Settings.kxf
    $GCSForm = GUICreate("ST SQL Importer - Settings", 419, 288, 674, 219, -1, -1, $GMForm)
    $GMsSQL = GUICtrlCreateGroup("MSSQL", 8, 8, 401, 73)
    $LCMSLogin = GUICtrlCreateLabel("Login", 16, 26, 30, 18)
    $ICMSLogin = GUICtrlCreateInput("", 56, 24, 129, 22)
    $LCMSPassword = GUICtrlCreateLabel("Password", 208, 26, 54, 18)
    $ICMSPassword = GUICtrlCreateInput("", 272, 24, 129, 22)
    $LCMSServer = GUICtrlCreateLabel("Server", 16, 56, 37, 18)
    $ICMSServer = GUICtrlCreateInput("", 56, 53, 225, 22)
    $LCMSPort = GUICtrlCreateLabel("Port", 304, 56, 23, 18)
    $ICMSPort = GUICtrlCreateInput("", 336, 53, 65, 22)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $GMySQL = GUICtrlCreateGroup("MYSQL", 8, 88, 401, 73)
    $LCMYLogin = GUICtrlCreateLabel("Login", 16, 106, 30, 18)
    $ICMYLogin = GUICtrlCreateInput("", 56, 104, 129, 22)
    $LCMYPassword = GUICtrlCreateLabel("Password", 208, 106, 54, 18)
    $ICMYPassword = GUICtrlCreateInput("", 272, 104, 129, 22)
    $LCMYServer = GUICtrlCreateLabel("Server", 16, 136, 37, 18)
    $ICMYServer = GUICtrlCreateInput("", 56, 133, 225, 22)
    $LCMYPort = GUICtrlCreateLabel("Port", 304, 136, 23, 18)
    $ICMYPort = GUICtrlCreateInput("", 336, 133, 65, 22)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $GPath = GUICtrlCreateGroup("PATH", 8, 168, 401, 81)
    $LCSLocal = GUICtrlCreateLabel("Local", 16, 186, 30, 18)
    $ICSLocal = GUICtrlCreateInput("", 56, 184, 257, 22)
    $BCSLocalBrowse = GUICtrlCreateButton("Browse", 328, 182, 75, 25)
    $LCSRemote = GUICtrlCreateLabel("Remote", 16, 221, 40, 18)
    $ICSRemote = GUICtrlCreateInput("", 56, 219, 257, 22)
    $BCSRemoteBrowse = GUICtrlCreateButton("Browse", 328, 217, 75, 25)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $BCSClose = GUICtrlCreateButton("Close", 336, 256, 75, 25)
    $BCSApply = GUICtrlCreateButton("Apply", 256, 256, 75, 25)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###
EndFunc   ;==>CSettingForm

While 1
    $nMsg = GUIGetMsg(1)
    Switch $nMsg[1]

        Case $GMForm
            Switch $nMsg[0]
                Case $BSetting
                    CSettingForm()
                Case $BClose
                    Exit
            EndSwitch

        Case $GCSForm
            Switch $nMsg[0]
                Case $BCSClose
                    GUIDelete($GCSForm)
            EndSwitch


    EndSwitch
    Sleep(2000)
WEnd
Edited by biase

Share this post


Link to post
Share on other sites
UEZ

Check out the line 76: GUIDelete($GCSForm) will be called.

Try this way:

#include-once
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

;~ Setting Control
Global $GCSForm, $GMsSQL, $LCMSLogin, $ICMSLogin, $LCMSPassword, $ICMSPassword, $LCMSServer, $ICMSServer, $LCMSPort, $ICMSPort, $GMySQL, $LCMYLogin, $ICMYLogin, $LCMYPassword
Global $ICMYPassword, $LCMYServer, $ICMYServer, $LCMYPort, $ICMYPort, $GPath, $LCSLocal, $ICSLocal, $BCSLocalBrowse, $LCSRemote, $ICSRemote, $BCSRemoteBrowse, $BCSClose, $BCSApply

#Region ### START Koda GUI section ### Form=F:\MySoft\Factory\Portable AutoIt3 v3.3.6.1\Form Desinger\Forms\ST SQL Importer.kxf
$GMForm = GUICreate("ST SQL Importer", 627, 449, 289, 154)
$BClose = GUICtrlCreateButton("Close", 544, 416, 75, 25)
$BMinimize = GUICtrlCreateButton("Minimize", 464, 416, 75, 25)
$BPause = GUICtrlCreateButton("Pause", 88, 416, 75, 25)
$BStart = GUICtrlCreateButton("Start", 8, 416, 75, 25)
$BSetting = GUICtrlCreateButton("Setting", 168, 416, 75, 25)
$ELog = GUICtrlCreateEdit("", 8, 8, 609, 401, BitOR($ES_AUTOVSCROLL, $ES_READONLY, $ES_WANTRETURN, $WS_VSCROLL))
GUICtrlSetBkColor(-1, 0xFFFFFF)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

Func CSettingForm()
    #Region ### START Koda GUI section ### Form=F:\MySoft\Factory\Portable AutoIt3 v3.3.6.1\Form Desinger\Forms\ST SQL Importer -Settings.kxf
    $GCSForm = GUICreate("ST SQL Importer - Settings", 419, 288, 674, 219)
    $GMsSQL = GUICtrlCreateGroup("MSSQL", 8, 8, 401, 73)
    $LCMSLogin = GUICtrlCreateLabel("Login", 16, 26, 30, 18)
    $ICMSLogin = GUICtrlCreateInput("", 56, 24, 129, 22)
    $LCMSPassword = GUICtrlCreateLabel("Password", 208, 26, 54, 18)
    $ICMSPassword = GUICtrlCreateInput("", 272, 24, 129, 22)
    $LCMSServer = GUICtrlCreateLabel("Server", 16, 56, 37, 18)
    $ICMSServer = GUICtrlCreateInput("", 56, 53, 225, 22)
    $LCMSPort = GUICtrlCreateLabel("Port", 304, 56, 23, 18)
    $ICMSPort = GUICtrlCreateInput("", 336, 53, 65, 22)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $GMySQL = GUICtrlCreateGroup("MYSQL", 8, 88, 401, 73)
    $LCMYLogin = GUICtrlCreateLabel("Login", 16, 106, 30, 18)
    $ICMYLogin = GUICtrlCreateInput("", 56, 104, 129, 22)
    $LCMYPassword = GUICtrlCreateLabel("Password", 208, 106, 54, 18)
    $ICMYPassword = GUICtrlCreateInput("", 272, 104, 129, 22)
    $LCMYServer = GUICtrlCreateLabel("Server", 16, 136, 37, 18)
    $ICMYServer = GUICtrlCreateInput("", 56, 133, 225, 22)
    $LCMYPort = GUICtrlCreateLabel("Port", 304, 136, 23, 18)
    $ICMYPort = GUICtrlCreateInput("", 336, 133, 65, 22)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $GPath = GUICtrlCreateGroup("PATH", 8, 168, 401, 81)
    $LCSLocal = GUICtrlCreateLabel("Local", 16, 186, 30, 18)
    $ICSLocal = GUICtrlCreateInput("", 56, 184, 257, 22)
    $BCSLocalBrowse = GUICtrlCreateButton("Browse", 328, 182, 75, 25)
    $LCSRemote = GUICtrlCreateLabel("Remote", 16, 221, 40, 18)
    $ICSRemote = GUICtrlCreateInput("", 56, 219, 257, 22)
    $BCSRemoteBrowse = GUICtrlCreateButton("Browse", 328, 217, 75, 25)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $BCSClose = GUICtrlCreateButton("Close", 336, 256, 75, 25)
    $BCSApply = GUICtrlCreateButton("Apply", 256, 256, 75, 25)
    GUISetState(@SW_SHOW)
    While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
            Case $BCSClose
                    GUIDelete($GCSForm)
                    ExitLoop
        EndSwitch
    WEnd
    #EndRegion ### END Koda GUI section ###
EndFunc   ;==>CSettingForm

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $BSetting
            CSettingForm()
        Case $BClose
            Exit
    EndSwitch
WEnd

Br,

UEZ


Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites
biase

It's work.

But I still did not understand, in other gui I've tried did show the GUI, but not this one.

If someone can explain a bit this to me to understand AutoIT GUI a little more.

Thanks UEZ.

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  

×