Michael36 Posted September 28, 2005 Share Posted September 28, 2005 Hi i'm very new to autoit and all i'm trying to do is use a button and a msgbox click the button and get a msgbox would someone be so kind as to give me a lil example on how to do this i been looking in the help book but no luck . thank you michael Link to comment Share on other sites More sharing options...
Valuater Posted September 28, 2005 Share Posted September 28, 2005 on your computer press the following Start > All Programs > Autoit v3 > Autoit Help File when that loads then press the "search" tab then type in "?your search?" and press "List Topics" **** you can do this with any word you want thats what i do all the time but.... here is a good one for ya expandcollapse popup;------------------------------------------------------------------------------------- ; Example - Press the button to see the value of the radio boxes ; The script also detects state changes (closed/minimized/timeouts, etc). #include <GUIConstants.au3> Opt("GUICoordMode", 1) GUICreate("Radio Box Demo", 400,280) ; Create the controls $button_1 = GUICtrlCreateButton ("B&utton 1", 30, 20, 120, 40) $group_1 = GUICtrlCreateGroup ("Group 1", 30, 90, 165, 160) GUIStartGroup() $radio_1 = GUICtrlCreateRadio ("Radio &0", 50, 120, 70, 20) $radio_2 = GUICtrlCreateRadio ("Radio &1", 50, 150, 60, 20) $radio_3 = GUICtrlCreateRadio ("Radio &2", 50, 180, 60, 20) ; Init our vars that we will use to keep track of GUI events $radioval1 = 0 ; We will assume 0 = first radio button selected, 2 = last button $radioval2 = 2 ; Show the GUI GUISetState () ; In this message loop we use variables to keep track of changes to the radios, another ; way would be to use GUICtrlRead() at the end to read in the state of each control While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE MsgBox(0, "", "Dialog was closed") Exit Case $msg = $GUI_EVENT_MINIMIZE MsgBox(0,"", "Dialog minimized",2) Case $msg = $GUI_EVENT_MAXIMIZE MsgBox(0,"", "Dialog restored",2) Case $msg = $button_1 MsgBox(0, "Default button clicked", "Radio " & $radioval1 ) Case $msg >= $radio_1 AND $msg <= $radio_3 $radioval1 = $msg - $radio_1 EndSelect WEnd look at this... then check out the HELP files ... they all have examples (this was from the beta version) 8) Link to comment Share on other sites More sharing options...
Michael36 Posted September 28, 2005 Author Share Posted September 28, 2005 on your computer press the followingStart > All Programs > Autoit v3 > Autoit Help Filewhen that loads then press the "search" tabthen type in "?your search?" and press "List Topics"**** you can do this with any word you wantthats what i do all the timebut.... here is a good one for yaexpandcollapse popup;------------------------------------------------------------------------------------- ; Example - Press the button to see the value of the radio boxes ; The script also detects state changes (closed/minimized/timeouts, etc). #include <GUIConstants.au3> Opt("GUICoordMode", 1) GUICreate("Radio Box Demo", 400,280) ; Create the controls $button_1 = GUICtrlCreateButton ("B&utton 1", 30, 20, 120, 40) $group_1 = GUICtrlCreateGroup ("Group 1", 30, 90, 165, 160) GUIStartGroup() $radio_1 = GUICtrlCreateRadio ("Radio &0", 50, 120, 70, 20) $radio_2 = GUICtrlCreateRadio ("Radio &1", 50, 150, 60, 20) $radio_3 = GUICtrlCreateRadio ("Radio &2", 50, 180, 60, 20) ; Init our vars that we will use to keep track of GUI events $radioval1 = 0 ; We will assume 0 = first radio button selected, 2 = last button $radioval2 = 2 ; Show the GUI GUISetState () ; In this message loop we use variables to keep track of changes to the radios, another ; way would be to use GUICtrlRead() at the end to read in the state of each control While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE MsgBox(0, "", "Dialog was closed") Exit Case $msg = $GUI_EVENT_MINIMIZE MsgBox(0,"", "Dialog minimized",2) Case $msg = $GUI_EVENT_MAXIMIZE MsgBox(0,"", "Dialog restored",2) Case $msg = $button_1 MsgBox(0, "Default button clicked", "Radio " & $radioval1 ) Case $msg >= $radio_1 AND $msg <= $radio_3 $radioval1 = $msg - $radio_1 EndSelect WEndlook at this... then check out the HELP files ... they all have examples(this was from the beta version)8)thank you worked real good i was looking in the help book for some reson i could not fig it out but i got it from that example you got from the help beta book thanks 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