Manjish Posted February 13, 2009 Share Posted February 13, 2009 (edited) Ppl, Sorry for re-posting this same stuff.. but I posted it in general help and support, before realizing here is the most appropriate place to post, coz of this gui problem.. Here's my code: expandcollapse popup#include <EditConstants.au3> $file=FileOpen("c:\db.ini",1) #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 436, 221, 193, 125) $Group1 = GUICtrlCreateGroup("Make A Choice", 0, 0, 433, 217) $Button1 = GUICtrlCreateButton("Register", 24, 152, 169, 33, 0) $Button2 = GUICtrlCreateButton("Login", 240, 152, 169, 33, 0) $Label1 = GUICtrlCreateLabel("What Do You Wish To Do?", 136, 72, 135, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() if $nMsg=$GUI_EVENT_CLOSE then ExitLoop If $nMsg=$Button1 then Register() If $nMsg=$Button2 then Signin() WEnd Func Register() #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 460, 293, 193, 125) $Group1 = GUICtrlCreateGroup("Register", 0, 0, 457, 289) $Label1 = GUICtrlCreateLabel("Enter Registration Information", 40, 48, 143, 17) $input1=GUICtrlCreateInput("", 208, 104, 233, 21) $Label2 = GUICtrlCreateLabel("Username", 48, 104, 52, 17) $Label3 = GUICtrlCreateLabel("Password", 48, 160, 50, 17) $input2=GUICtrlCreateInput("", 208, 160, 233, 21, BitOR($ES_PASSWORD,$ES_AUTOHSCROLL)) $Button1 = GUICtrlCreateButton("OK", 160, 232, 169, 41, 0) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() if $nMsg=$GUI_EVENT_CLOSE then ExitLoop If $nMsg=$Button1 then IniWriteSection($file,"Information","") IniWrite($file,"Information",guictrlread($input1),guictrlread($input2)) GUIDelete($Form1) Return EndIf WEnd EndFunc What i am trying to here is this: 1) user will be presented, with 2 buttons.. login and register.. 2) when they press register.. the values in input box will be written in an ini file as username=password.. 3) and when OK button is pressed on the Register GUI, I want it to close, and again go back to previous GUI, with the two buttons.. 4) Now when i again press Register, it shud again launch register GUI.. This can be done for as many times as possible.. But this is not happening.. Please help me with this one, thanks.. Edited February 13, 2009 by Manjish [font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com Link to comment Share on other sites More sharing options...
jpm Posted February 13, 2009 Share Posted February 13, 2009 strange you create the second form as $form1 $button...You need to specialize your loopsomething like#include <GUIConstantsEx.au3>#include <EditConstants.au3>$file=FileOpen("c:\db.ini",1)#Region ### START Koda GUI section ### Form=$Form1 = GUICreate("Form1", 436, 221, 193, 125)$Group1 = GUICtrlCreateGroup("Make A Choice", 0, 0, 433, 217)$Button1 = GUICtrlCreateButton("Register", 24, 152, 169, 33, 0)$Button2 = GUICtrlCreateButton("Login", 240, 152, 169, 33, 0)$Label1 = GUICtrlCreateLabel("What Do You Wish To Do?", 136, 72, 135, 17)GUICtrlCreateGroup("", -99, -99, 1, 1)GUISetState(@SW_SHOW)#EndRegion ### END Koda GUI section ###While 1 $nMsg = GUIGetMsg() if $nMsg=$GUI_EVENT_CLOSE then ExitLoop If $nMsg=$Button1 then Register() ;If $nMsg=$Button2 then Signin()WEndFunc Register()#Region ### START Koda GUI section ### Form=$Form2 = GUICreate("Form2", 460, 293, 193, 125)$Group2 = GUICtrlCreateGroup("Register", 0, 0, 457, 289)$Label3 = GUICtrlCreateLabel("Enter Registration Information", 40, 48, 143, 17)$input1=GUICtrlCreateInput("", 208, 104, 233, 21)$Label4 = GUICtrlCreateLabel("Username", 48, 104, 52, 17)$Label5 = GUICtrlCreateLabel("Password", 48, 160, 50, 17)$input2=GUICtrlCreateInput("", 208, 160, 233, 21, BitOR($ES_PASSWORD,$ES_AUTOHSCROLL))$Button3 = GUICtrlCreateButton("OK", 160, 232, 169, 41, 0)GUICtrlCreateGroup("", -99, -99, 1, 1)GUISetState(@SW_SHOW)#EndRegion ### END Koda GUI section ###While 1 $nMsg = GUIGetMsg() if $nMsg=$GUI_EVENT_CLOSE then ExitLoop If $nMsg=$Button3 then IniWriteSection($file,"Information","") IniWrite($file,"Information",guictrlread($input1),guictrlread($input2)) ExitLoop EndIfWEnd GUIDelete($Form2)EndFunc Link to comment Share on other sites More sharing options...
Manjish Posted February 13, 2009 Author Share Posted February 13, 2009 thanks.. [font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com 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