StuparuIG Posted December 2, 2012 Share Posted December 2, 2012 (edited) expandcollapse popup#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> Global $hGUI2 = 9999, $hButton3 = 9999 gui1() Func gui1() #Region ### START Koda GUI section ### Form=c:usersuserdesktopautoitloginlogin.kxf $Form1_1 = GUICreate("Form1", 317, 160, 354, 197) $Input1 = GUICtrlCreateInput("", 24, 40, 121, 21) $Input2 = GUICtrlCreateInput("", 24, 88, 121, 21) $Login = GUICtrlCreateButton("Login", 128, 128, 75, 25, 0) $Try = GUICtrlCreateButton("Try", 218, 128, 75, 25, 0) $Username = GUICtrlCreateLabel("Username", 24, 16, 52, 17) $Password = GUICtrlCreateLabel("Password", 24, 64, 50, 17) GUISetState() #EndRegion ### END Koda GUI section ### While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $Login $USERNAME = GUICtrlRead($Input1) $PASSWORD = GUICtrlRead($Input2) If $Username = "admin" and $Password = "123" Then GUICtrlSetState($Login, $GUI_DISABLE) gui2() Else MsgBox (0,"login","erroare") EndIf EndSwitch WEnd EndFunc ;==>gui1 Func gui2() $hGUI2 = GUICreate("Gui 2", 200, 200, 350, 350) $hButton3 = GUICtrlCreateButton("MsgBox 2", 10, 10, 80, 30) GUISetState() EndFunc ;==>gui2 Edited December 2, 2012 by Melba23 Added code tags Link to comment Share on other sites More sharing options...
PlayHD Posted December 2, 2012 Share Posted December 2, 2012 next time please use 'autoit' tag now i don't understand your problem... you want this ? expandcollapse popup#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> Global $hGUI2 = 9999, $hButton3 = 9999 gui1() Func gui1() #Region ### START Koda GUI section ### Form=c:usersuserdesktopautoitloginlogin.kxf $Form1_1 = GUICreate("Form1", 317, 160, 354, 197) $Input1 = GUICtrlCreateInput("", 24, 40, 121, 21) $Input2 = GUICtrlCreateInput("", 24, 88, 121, 21) $Login = GUICtrlCreateButton("Login", 128, 128, 75, 25, 0) $Try = GUICtrlCreateButton("Try", 218, 128, 75, 25, 0) $Username = GUICtrlCreateLabel("Username", 24, 16, 52, 17) $Password = GUICtrlCreateLabel("Password", 24, 64, 50, 17) GUISetState() #EndRegion ### END Koda GUI section ### While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $Login $USERNAME = GUICtrlRead($Input1) $PASSWORD = GUICtrlRead($Input2) If $Username = "admin" and $Password = "123" Then GUICtrlSetState($Login, $GUI_DISABLE) gui2() Else MsgBox (0,"login","erroare") EndIf Case $Try MsgBox(0,"$Try","Try button was pressed",0,$Form1_1) EndSwitch WEnd EndFunc ;==>gui1 Func gui2() $hGUI2 = GUICreate("Gui 2", 200, 200, 350, 350) $hButton3 = GUICtrlCreateButton("MsgBox 2", 10, 10, 80, 30) GUISetState() EndFunc ;==>gui2 My UDF : _WinShake, _WinSplitMy Apps : Google Guitar Bot, PuzzleGameDesign Gui : Interesting Tabs Design, RBox Project (abandoned), Animated Gui on Exit Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 2, 2012 Moderators Share Posted December 2, 2012 StuparuIG,Welcome to the AutoIt forum. Add a Case to your loop to detect the button event: expandcollapse popup#include <GUIConstantsEx.au3> Global $hGUI2 = 9999, $hButton3 = 9999 gui1() Func gui1() $Form1_1 = GUICreate("Form1", 317, 160, 354, 197) $Input1 = GUICtrlCreateInput("", 24, 40, 121, 21) $Input2 = GUICtrlCreateInput("", 24, 88, 121, 21) $Login = GUICtrlCreateButton("Login", 128, 128, 75, 25, 0) $Try = GUICtrlCreateButton("Try", 218, 128, 75, 25, 0) $Username = GUICtrlCreateLabel("Username", 24, 16, 52, 17) $Password = GUICtrlCreateLabel("Password", 24, 64, 50, 17) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $Login $Username = GUICtrlRead($Input1) $Password = GUICtrlRead($Input2) If $Username = "admin" And $Password = "123" Then GUICtrlSetState($Login, $GUI_DISABLE) gui2() Else MsgBox(0, "login", "erroare") EndIf Case $hButton3 ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< MsgBox(0, "Hi", "MsgBox 2 at your service") EndSwitch WEnd EndFunc ;==>gui1 Func gui2() $hGUI2 = GUICreate("Gui 2", 200, 200, 350, 350) $hButton3 = GUICtrlCreateButton("MsgBox 2", 10, 10, 80, 30) GUISetState() EndFunc ;==>gui2You might find the Managing Multiple GUIs tutorial in the Wiki of interest. M23P.S. When you post code please use Code tags - put [autoit] before and [/autoit] after your posted code. Then you get a scrolling box as you can see above now I have added the tags. Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
StuparuIG Posted December 2, 2012 Author Share Posted December 2, 2012 thank you 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