Boss007 Posted June 17, 2012 Posted June 17, 2012 (edited) Hi this script displays amessage box asking a user to choose their gender. once they have done this I need to give the user a second chance incase they clicked on the wrong gender. a msg box is displayed asking to confirm. I'm stuck on how to create the loop from this messagebox,and how to reposition the msg box so that it appears on top and in line with the main window.any pointers would be apprieciated thanks! expandcollapse popup#include <buttonconstants.au3> #include <guiconstantsex.au3> #include <windowsconstants.au3> #Region ### START Koda GUI section ### Form=gender select.kxf $Form2 = GUICreate("Select Gender", 279, 213, 361, 262) GUISetBkColor(0xA0A0A4) $GroupBox1 = GUICtrlCreateGroup("", 24, 1, 233, 193) GUICtrlSetBkColor(-1, 0xA0A0A4) $label2 = GUICtrlCreateLabel("or", 135, 168, 15, 17) GUICtrlSetBkColor(-1, 0xA0A0A4) $Label1 = GUICtrlCreateLabel("Click on the Gender of the New User", 48, 136, 177, 18) GUICtrlCreateGroup("", -99, -99, 1, 1) $Button1 = GUICtrlCreateButton("Male", 30, 163, 75, 25, $BS_PUSHLIKE) GUICtrlSetBkColor(-1, 0x0054E3) $Button2 = GUICtrlCreateButton("Female", 173, 163, 75, 25, $BS_PUSHLIKE) GUICtrlSetBkColor(-1, 0xFF00FF) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE ;insert code here MsgBox(4, "", "Are you sure ? This will Install the Default settings") ;I would like to install from here or go back to the beging dependent on the response to ;the yes or no buttons displayed by the msgbox4 function. yes =instal and exit no = go back to the begining ;of selection routine. ;I need the msgbox to be displayed in line with and on top of the main window Exit Case $Button1 _maleFunction() Case $Button2 _femaleFunction() EndSwitch WEnd Func _maleFunction() ;insert code here MsgBox(4, "", "Are you sure about Installing settings for a Male ?") ;I would like to install from here or go back to the beging dependent on the response to ; the yes or no buttons displayed by the msgbox4 function. yes =install and exit,no = go back to the begining ;I need the msgbox to be displayed in line with and on top of the main window ;I need to store the response into a variable for later use Exit EndFunc Func _femaleFunction() ;insert code here MsgBox(4, "", "Are you sure about Installing Female settings?") ;I would like to install from here or go back to the beging dependent on the response to ; the yes or no buttons displayed by the msgbox4 function. yes =install and exit, no = go back to the begining Exit EndFuncvxpgs3b.au3 Edited June 17, 2012 by Melba23 Added code tags
Moderators Melba23 Posted June 17, 2012 Moderators Posted June 17, 2012 Boss007,When you post code in future please use Code tags - put [autoit] before and [/autoit] after your posted code. Then you get the code in a nice scrolling box - as you can see above where I have added them for you. M23 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
Boss007 Posted June 17, 2012 Author Posted June 17, 2012 Boss007, When you post code in future please use Code tags - put before and after your posted code. Then you get the code in a nice scrolling box - as you can see above where I have added them for you. M23 ok! thank you. I was going to ask about that.
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