toolauto Posted June 5, 2012 Author Share Posted June 5, 2012 #include <GUIConstantsEx.au3> Example() Func Example() Local $Button_1,$msg GUICreate("Auto",120,70) ; will create a dialog box that when displayed is centered Opt("GUICoordMode", 2) $Button_1 = GUICtrlCreateButton("Run", 10, 30, 100) GUISetState() ; will display an dialog box with 2 button ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button_1 Run('E:AutoITauto1.exe') ; Will Run Auto EndSelect WEnd EndFunc ;==>Example No man I only can do this , make a button to display it on screen Link to comment Share on other sites More sharing options...
JohnQSmith Posted June 6, 2012 Share Posted June 6, 2012 (edited) No man I only can do this , make a button to display it on screen Your copy and paste skills are outstanding! Not only can you copy an example from somdcomputerguy, but also from the GUICtrlCreateButton section of the help file! You even managed to edit out the extra button. Instead of just copying and pasting from the help file, try actually reading it and understanding what the examples are doing. #include <GUIConstantsEx.au3> Example() Func Example() Local $Button_1, $Button_2, $msg GUICreate("My GUI Button") ; will create a dialog box that when displayed is centered Opt("GUICoordMode", 2) $Button_1 = GUICtrlCreateButton("Run Notepad", 10, 30, 100) $Button_2 = GUICtrlCreateButton("Button Test", 0, -1) GUISetState() ; will display an dialog box with 2 button ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button_1 Run('notepad.exe') ; Will Run/Open Notepad Case $msg = $Button_2 MsgBox(0, 'Testing', 'Button 2 was pressed') ; Will demonstrate Button 2 being pressed EndSelect WEnd EndFunc ;==>Example Edited June 6, 2012 by JohnQSmith Whenever someone says "pls" because it's shorter than "please", I say "no" because it's shorter than "yes". 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