Kickassjoe Posted March 11, 2008 Posted March 11, 2008 is there a way that I could make the GUI think that a button is clicked, when another button is pressed using GUISetOnEvent mode? (I know i could just make it go to the same function, or use a hotkeyset / send combination, but is there any function that does it automagically?) Opt("GuiOnEventMode", 1) GUICreate("Test") Global $B1 = GUICtrlCreateButton("Exit!", 10, 10) GUICtrlSetOnEvent($B1, "transferclick") Global $B2 = GUICtrlCreateButton("NOW!", 10, 40) GUICtrlSetOnEvent($B2, "exitnow") GUISetOnEvent(-3, "exitnow") GUISetState() While 1 Sleep(100000) WEnd Func transferclick() ;@GUI_CtrlId = $B2; doesn't work :( EndFunc Func exitnow() Exit EndFunc What goes around comes around... Payback's a bitch.
smashly Posted March 11, 2008 Posted March 11, 2008 Hi,Opt("GuiOnEventMode", 1) GUICreate("Test") $B1 = GUICtrlCreateButton("Exit!", 10, 10) GUICtrlSetOnEvent(-1, "Event") $B2 = GUICtrlCreateButton("NOW!", 10, 40) GUICtrlSetOnEvent(-1, "Event") GUISetOnEvent(-3, "Event") GUISetState() While 1 Sleep(100) WEnd Func Event() $msg = @GUI_CtrlId Switch $msg Case $B1, $B2, -3 Exit Case Else ;;; EndSwitch EndFunc Cheers
Kickassjoe Posted March 11, 2008 Author Posted March 11, 2008 Hmm... Not what I was looking for, but I think I discovered what I need to do, thanks. What goes around comes around... Payback's a bitch.
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