Jump to content

Recommended Posts

Posted (edited)

hey guys can you tell me what wrong with this where its commented....

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Include <GuiEdit.au3>
#include <StaticConstants.au3>

GUICreate("Reason for Reset", 547, 154, 238, 237)
GUISetOnEvent($GUI_EVENT_CLOSE, "Cancel_Click")
GUICtrlCreateLabel("Please enter your reason for reseting the button to run it again:", 128, 16, 291, 17)
$ReasonIn = GUICtrlCreateInput("", 48, 48, 449, 21)
$Ok = GUICtrlCreateButton("OK", 144, 96, 121, 33, 0 ,$BS_DEFPUSHBUTTON)   ;*****************This doesn't work
$Cancel = GUICtrlCreateButton("Cancel", 288, 96, 121, 33, 0)
GUISetState(@SW_SHOW)
GUICtrlSetOnEvent($Ok, "OkClick")
GUICtrlSetOnEvent($Cancel, "Cancel_Click")

(I know I've got too many Includes at the top also...I just copy n pasted them from the script this came from)

When I run it, if i press the enter key it doesn't do anything.

All help will be appreciated

BUMP - I looked closer at it once i posted it and got it working

Edited by LurchMan

Dating a girl is just like writing software. Everything's going to work just fine in the testing lab (dating), but as soon as you have contract with a customer (marriage), then your program (life) is going to be facing new situations you never expected. You'll be forced to patch the code (admit you're wrong) and then the code (wife) will just end up all bloated and unmaintainable in the end.

Posted

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Include <GuiEdit.au3>
#include <StaticConstants.au3>

Opt("GUIOnEventMode", 1)

GUICreate("Reason for Reset", 547, 154, 238, 237)

GUISetOnEvent($GUI_EVENT_CLOSE, "Cancel_Click")

GUICtrlCreateLabel("Please enter your reason for reseting the button to run it again:", 128, 16, 291, 17)
$ReasonIn = GUICtrlCreateInput("", 48, 48, 449, 21)
$Ok = GUICtrlCreateButton("OK", 144, 96, 121, 33, $BS_DEFPUSHBUTTON)   ;*****************This doesn't work
$Cancel = GUICtrlCreateButton("Cancel", 288, 96, 121, 33, 0)
GUISetState(@SW_SHOW)
GUICtrlSetOnEvent($Ok, "OkClick")
GUICtrlSetOnEvent($Cancel, "Cancel_Click")

while 1
    sleep(10)
WEnd

func OkClick()
    MsgBox(0,"","Ok clicked")
EndFunc

func Cancel_Click()
    MsgBox(0,"","Cancel clicked")
EndFunc

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
×
×
  • Create New...