Sign in to follow this  
Followers 0
derblub

gui-problem

3 posts in this topic

hi all and thx in advance!

i have finished my tool, and now im recreating the gui.. but i got a "small" error..

everytime i click into the input box on the main window or on the up/down buttons, the window flashes - and im unable to close the window...

what can it be?!

#include <GuiConstants.au3>


GuiCreate("Quotenlisten-TOOL",166,73,-1,-1,$WS_POPUPWINDOW)
WinSetOnTop("Quotenlisten-TOOL","",1)

$gui_start  = GuiCtrlCreateLabel("Quotenlisten-Tool starten?", 18, 11, 130, 20)
$b_ja       = GuiCtrlCreateButton("Ja", 14, 40, 60, 20)
$b_nein     = GuiCtrlCreateButton("Nein", 91, 40, 60, 20)

GuiSetState()
While 1
    $msg = GuiGetMsg()
    Switch $msg
        Case $b_ja
            
            GUIDelete()
            $gui_haupt = GUICreate("Quotenlisten-TOOL", 297, 230, -1, -1)
            GUICtrlCreateLabel("Quotenlisten alle", 5, 14, 80, 20)
            
            $i_mins = GUICtrlCreateInput("10", 90, 11, 50, 20, $ES_NUMBER)
            GUICtrlCreateUpdown(-1)
            GUICtrlSetLimit(-1,9999,10)
            GUICtrlCreateLabel("Minuten drucken und uploaden", 143, 16, 161, 17)
            
            $b_start = GUICtrlCreateButton("START", 110, 40, 70, 20)
            
            $ch_aot = GuiCtrlCreateCheckbox("always on top", 200, 42, 90, 20)
            GUICtrlSetState(-1,$GUI_CHECKED)
            
            $infotext = GUICtrlCreateLabel("                (im stop-modus)", 60, 70, 190, 20)
            
            $pr_print = GuiCtrlCreateProgress(70, 90, 190, 10, $PBS_SMOOTH)
            $pr_up    = GuiCtrlCreateProgress(70, 103, 190, 10, $PBS_SMOOTH)
            GuiCtrlCreateLabel("print-status", 15, 88, 52, 15)
            GuiCtrlCreateLabel("upload-status", 3, 101, 64, 15)
            $printprozent = GuiCtrlCreateLabel("0%", 261, 88, 40, 15)
            $upprozent = GuiCtrlCreateLabel("0%", 261, 101, 40, 15)
            
            $ed_status = GUICtrlCreateEdit("", 10, 120, 277, 100)
            GUICtrlSetState(-1, $GUI_DISABLE)
            GuiSetState()
            $msg2 = GuiGetMsg()
            
            Switch $msg2
                Case -3
                    Exit
            EndSwitch
        Case $b_nein
            Exit
    EndSwitch
WEnd
Exit

thx for all help!

Share this post


Link to post
Share on other sites



Try this:

#include <GuiConstants.au3>


$Main=GuiCreate("Quotenlisten-TOOL",166,73,-1,-1,$WS_POPUPWINDOW)
WinSetOnTop("Quotenlisten-TOOL","",1)

$gui_start  = GuiCtrlCreateLabel("Quotenlisten-Tool starten?", 18, 11, 130, 20)
$b_ja     = GuiCtrlCreateButton("Ja", 14, 40, 60, 20)
$b_nein   = GuiCtrlCreateButton("Nein", 91, 40, 60, 20)

GuiSetState()

; Child Gui
$gui_haupt = GUICreate("Quotenlisten-TOOL", 297, 230, -1, -1,-1,-1,$Main)
GUICtrlCreateLabel("Quotenlisten alle", 5, 14, 80, 20)

$i_mins = GUICtrlCreateInput("10", 90, 11, 50, 20, $ES_NUMBER)
GUICtrlCreateUpdown(-1)
GUICtrlSetLimit(-1,9999,10)
GUICtrlCreateLabel("Minuten drucken und uploaden", 143, 16, 161, 17)

$b_start = GUICtrlCreateButton("START", 110, 40, 70, 20)

$ch_aot = GuiCtrlCreateCheckbox("always on top", 200, 42, 90, 20)
GUICtrlSetState(-1,$GUI_CHECKED)

$infotext = GUICtrlCreateLabel("                (im stop-modus)", 60, 70, 190, 20)

$pr_print = GuiCtrlCreateProgress(70, 90, 190, 10, $PBS_SMOOTH)
$pr_up  = GuiCtrlCreateProgress(70, 103, 190, 10, $PBS_SMOOTH)
GuiCtrlCreateLabel("print-status", 15, 88, 52, 15)
GuiCtrlCreateLabel("upload-status", 3, 101, 64, 15)
$printprozent = GuiCtrlCreateLabel("0%", 261, 88, 40, 15)
$upprozent = GuiCtrlCreateLabel("0%", 261, 101, 40, 15)

$ed_status = GUICtrlCreateEdit("", 10, 120, 277, 100)
GUICtrlSetState(-1, $GUI_DISABLE)
While 1
    $msg = GuiGetMsg(1)
    Switch $msg[0]
        Case $b_ja
            GUISetState(@SW_HIDE,$Main)
            GUISetState(@SW_SHOW,$gui_haupt)
        Case $b_nein
            Exit
        Case $GUi_EVENT_CLOSE
            Exit
    EndSwitch
WEnd
Exit

If you don't understand what I did, just ask :)

Share this post


Link to post
Share on other sites

thx very much! :) very clever - i got it!

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  
Followers 0