SaKu Posted April 12, 2008 Share Posted April 12, 2008 Hi, i try to make my first GUI. I made a new little GUI to explain my problem: #include <GUIConstants.au3> $GUI = GUICreate("GUI Output Test", 154, 102, 193, 125) $input = GUICtrlCreateInput("", 24, 24, 97, 21) $start = GUICtrlCreateButton("Go!", 24, 56, 97, 25, 0) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $start MsgBox(0,"Output",$input) Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd If I type anything in the inputfield, the variable will give me the number "3". Why is this? I want to have the text written in the input-field in my variable! Please help me . Link to comment Share on other sites More sharing options...
Madza91 Posted April 12, 2008 Share Posted April 12, 2008 Use GuiCtrlRead()#include <GUIConstants.au3>$GUI = GUICreate("GUI Output Test", 154, 102, 193, 125)$input = GUICtrlCreateInput("", 24, 24, 97, 21)$start = GUICtrlCreateButton("Go!", 24, 56, 97, 25, 0)GUISetState(@SW_SHOW)While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $start MsgBox(0,"Output",GUICtrlRead($input)) Case $GUI_EVENT_CLOSE Exit EndSwitchWEnd [quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :) Link to comment Share on other sites More sharing options...
z0mgItsJohn Posted April 12, 2008 Share Posted April 12, 2008 When You Want To Read A GUI Variable You Must Use GUICtrlRead ($Variable)oÝ÷ Øw«zÆ(¹'+Ejëh×6#include <GUIConstants.au3> $GUI = GUICreate("GUI Output Test", 154, 102, 193, 125) $input = GUICtrlCreateInput("", 24, 24, 97, 21) $start = GUICtrlCreateButton("Go!", 24, 56, 97, 25, 0) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $start MsgBox(0,"Output",GUICtrlRead ($input)) Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Hope This Helps :] ~ John Latest Projects :- New & Improved TCP Chat Link to comment Share on other sites More sharing options...
SaKu Posted April 12, 2008 Author Share Posted April 12, 2008 Thanks! I knew i did something wrong . Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now