Rafaelinio Posted November 1, 2013 Share Posted November 1, 2013 HI guys. #include <GUIConstantsEx.au3> GUI() Func GUI() Local $msg, $Button1, $MsgTitle, $Message, $ChckBox1 GUICreate("Simple Program Generator") Opt("GUICoordMode", 2) $Button1 = GUICtrlCreateButton("Create a simple message box",1,1, 402, 50) $ChckBox1 = GUICtrlCreateCheckbox("Loop", -400, 0, 50, 50) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button1 $MsgTitle = InputBox("Insert Title", "Please Insert Your Message Box Title:") $Message = InputBox("Insert Message", "Please Insert The Message:") MsgBox(0, $MsgTitle, $Message) Case $msg = $ChckBox1 EndSelect Wend EndFunc how do i tell if check box is checked so when i press the button it loops the message? Link to comment Share on other sites More sharing options...
Solution Zedna Posted November 1, 2013 Solution Share Posted November 1, 2013 I don't know what you mean by looping MessageBox inside GUI which is nonsense, so here is only answer for question about reading state of chcekbox #include <GUIConstantsEx.au3> Global $checked Local $msg, $Button1, $MsgTitle, $Message, $ChckBox1 GUICreate("Simple Program Generator") Opt("GUICoordMode", 2) $Button1 = GUICtrlCreateButton("Create a simple message box",1,1, 402, 50) $ChckBox1 = GUICtrlCreateCheckbox("Loop", -400, 0, 50, 50) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button1 $MsgTitle = InputBox("Insert Title", "Please Insert Your Message Box Title:") $Message = InputBox("Insert Message", "Please Insert The Message:") $checked = BitAND(GUICtrlRead($ChckBox1), $GUI_CHECKED) = $GUI_CHECKED If $checked Then MsgBox(0, $MsgTitle & ' checked', $Message) Else MsgBox(0, $MsgTitle & ' not checked', $Message) EndIf Case $msg = $ChckBox1 EndSelect Wend Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Rafaelinio Posted November 1, 2013 Author Share Posted November 1, 2013 I mean loopinng a message for how long the user wants to(still didnt added that option) but thanks anyways 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