Sign in to follow this  
Followers 0
nerdgerl

GUICtrlRead won't show

3 posts in this topic

Look at how simple this code is - when run, the entered values won't show in the message box. WhY??????????

#include <GuiCombo.au3>
#include <file.au3>
#include <array.au3>
#Include <GuiEdit.au3>
#include <GUIConstants.au3>
#include <Misc.au3>

$HRForm = GUICreate("AForm1", 257, 194, -1, -1)

GUICtrlCreateLabel("Length", 5, 5, 37, 17)
$HRLength = GUICtrlCreateInput("", 5, 23, 245, 21)

GUICtrlCreateLabel("Thickness", 5, 53, 53, 17)
$HRThickness = GUICtrlCreateInput("", 5, 71, 245, 21)

GUICtrlCreateLabel("Color", 5, 99, 28, 17)
$HRColor = GUICtrlCreateCombo("", 5, 117, 245, 100)
GUICtrlSetData($HRColor,"aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|purple|red|silver|teal|white|yellow","aqua")

$HROK = GUICtrlCreateButton("OK", 119, 146, 61, 25, 0)
$HRCancel = GUICtrlCreateButton("Cancel", 188, 146, 61, 25, 0)
GUISetState(@SW_SHOW)
While 1
    $hrmsg = GuiGetMsg()
    Select
        Case $hrmsg = $GUI_EVENT_CLOSE
        GUIDelete($HRForm)
        ExitLoop
        
        Case $hrmsg = $HROK
        GUIDelete($HRForm)
        msgbox (0,"",'<HR WIDTH="' & GUICtrlRead($HRLength) & '" SIZE="' & GUICtrlRead($HRThickness) & '" COLOR="' & GUICtrlRead($HRColor) & '">')
        ExitLoop

        Case $hrmsg = $HRCancel
        GUIDelete($HRForm)
        ExitLoop
        
    EndSelect
WEnd

My AutoIT's:[topic="53958"]Personal Encyclopedia/Dictionary[/topic][topic="46311"]MS Access (Style) Database[/topic]"Some people are born on third base and go through life thinking they hit a triple."

Share this post


Link to post
Share on other sites



Because of the GUIDelete. If you don't to the GUI to be shown when the

MsgBox pops up just hide it first with GUISetState, or you could read the

values to variables, delete the GUI and then show MsgBox.

Share this post


Link to post
Share on other sites

Because of the GUIDelete. If you don't to the GUI to be shown when the

MsgBox pops up just hide it first with GUISetState, or you could read the

values to variables, delete the GUI and then show MsgBox.

Hot diggity! Thank you Helge!


My AutoIT's:[topic="53958"]Personal Encyclopedia/Dictionary[/topic][topic="46311"]MS Access (Style) Database[/topic]"Some people are born on third base and go through life thinking they hit a triple."

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