ken82m Posted May 6, 2006 Share Posted May 6, 2006 I have a GUI in on event mode and I am updating some GUIControls using custom functions. The controls do update however all of my OnEvent commands are worthless. The only way I can close it is with task manager or the icon in the taskbar. I have tried declaring the variables for my controls and Global variables but it didn't help. The real script is to damn big but here is enough of a script to reproduce what I'm doing. Any help would be appreciated. Thanks, Kenny #include <GuiConstants.au3> AutoItSetOption("GUIOnEventMode", 1) ;Declare Global Variables that will be used used by Custom Functions Global $Label_1 Global $Button_1 GuiCreate("CWD ITS Department - PC Quality Control Check", 863, 575,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $Label_1 = GuiCtrlCreateLabel("Hardware Inventory", 100, 10, 100, 20) $Button_1 = GUICtrlCreateButton("Refresh All Settings", 675, 30, 180, 20) GUICtrlSetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked") GUICtrlSetOnEvent($Button_1, "Test") GUISetState(@SW_SHOW) While 1 Sleep(1000) WEnd Func CLOSEClicked () Exit EndFunc Func Test () GUICtrlSetData($Label_1, "test") GUICtrlSetData($Button_1, "test") EndFunc "I believe that when we leave a place, part of it goes with us and part of us remains... Go anywhere, when it is quiet, and just listen.. After a while, you will hear the echoes of all our conversations, every thought and word we've exchanged.... Long after we are gone our voices will linger in these walls for as long as this place remains." Link to comment Share on other sites More sharing options...
Valuater Posted May 6, 2006 Share Posted May 6, 2006 i think i got it #include <GuiConstants.au3> AutoItSetOption("GUIOnEventMode", 1) ;Declare Global Variables that will be used used by Custom Functions Global $Label_1 Global $Button_1 GuiCreate("CWD ITS Department - PC Quality Control Check", 863, 575);,-1, -1 ,BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked"); ******* moved to here $Label_1 = GuiCtrlCreateLabel("Hardware Inventory", 100, 10, 100, 20) $Button_1 = GUICtrlCreateButton("Refresh All Settings", 675, 30, 180, 20) GUICtrlSetOnEvent($Button_1, "Test") GUISetState(@SW_SHOW) While 1 Sleep(1000) WEnd Func CLOSEClicked() Exit EndFunc Func Test () GUICtrlSetData($Label_1, "test") GUICtrlSetData($Button_1, "test") EndFunc 8) Link to comment Share on other sites More sharing options...
ken82m Posted May 6, 2006 Author Share Posted May 6, 2006 no good I tried it on my test script, but I can't close it no matter what with or without your suggestion. What am I doing wrong it looks fine "I believe that when we leave a place, part of it goes with us and part of us remains... Go anywhere, when it is quiet, and just listen.. After a while, you will hear the echoes of all our conversations, every thought and word we've exchanged.... Long after we are gone our voices will linger in these walls for as long as this place remains." Link to comment Share on other sites More sharing options...
Valuater Posted May 6, 2006 Share Posted May 6, 2006 no good I tried it on my test script, but I can't close it no matter what with or without your suggestion. What am I doing wrong it looks finemine worked... right??8) Link to comment Share on other sites More sharing options...
ken82m Posted May 6, 2006 Author Share Posted May 6, 2006 Kinda, I just moved the line you mentioned in my script which is why it still didn't work. I got it now though, thanks to your reply I found it, just compared yours to mine line by line. I hadn't realized there was a GUISetOnEvent and a GUICtrlSetOnEvent. I've only put together 2 or 3 GUI's with this and it's been some time since I built the last one. Thanks, Kenny Anyway after replacing several commands I got it GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked") GUICtrlSetOnEvent($Button_18, "RefreshAll") GUICtrlSetOnEvent($Button_1, "EnableRDP") Thanks for the help man. "I believe that when we leave a place, part of it goes with us and part of us remains... Go anywhere, when it is quiet, and just listen.. After a while, you will hear the echoes of all our conversations, every thought and word we've exchanged.... Long after we are gone our voices will linger in these walls for as long as this place remains." 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