Jump to content

Button Commands & Functions


Recommended Posts

Good Morning All,

I have been searching through the forums and I have not come to a solution just yet and was wondering if someone could spare a few minutes to provide some assistance.

All I would like to know is how to add commands / functions to buttons. This is the code I have which was generated when I placed the button on my Form:

$BtnRestartNow = GUICtrlCreateButton("Restart Now", 100, 167, 75, 25, 0)

In this instance, I would like to add the following function to it: Shutdown (6)

I've tried the following instances to get it working but all I receive is a Syntax error:

$BtnRestartNow = GUICtrlCreateButton("Restart Now", 100, 167, 75, 25, 0) Shutdown (6)
$BtnRestartNow = GUICtrlCreateButton("Restart Now", 100, 167, 75, 25, 0, Shutdown (6))
$BtnRestartNow = GUICtrlCreateButton("Restart Now", Shutdown (6), 100, 167, 75, 25, 0)

ERROR: syntax error
$BtnRestartNow = GUICtrlCreateButton("Restart Now", 100, 167, 75, 25, 0) Shutdown

Any assistance is much appreciated.

Regards,

Daniel E. Penning

Link to comment
Share on other sites

Hey mate,

I could type a full page of information, but it is easier to just read the AutoIt help file.

In SciTE (the editor) press F1. In the help go to: Auto It -> GUI Reference -> GUI MessageLoop Mode.

I find it the most easy way to make it work.

My active project(s): A-maze-ing generator (generates a maze)

My archived project(s): Pong3 (Multi-pinger)

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...