Jump to content
Sign in to follow this  
metis

GUICtrlSetOnEvent - 2GUI + Function

Recommended Posts

metis

What is wrong ?

Wrong ;/ HElp !!

GUI ...
Opt("GUIOnEventMode", 1)
GUICtrlSetOnEvent($Button1, "_zrob_kalkulacje")
GUISetOnEvent($GUI_EVENT_CLOSE, "exitgui1")
Example();

While 1
Sleep(100)
WEnd


Func _zrob_kalkulacje()
GUISetState(@SW_SHOW, $hGUI_calc)
EndFunc>


Func Example()

$tester = GUICreate("Parent1")
GUISetOnEvent($GUI_EVENT_CLOSE, "SpecialEvents")
GUISetOnEvent($GUI_EVENT_MINIMIZE, "SpecialEvents")
GUISetOnEvent($GUI_EVENT_RESTORE, "SpecialEvents")

GUICtrlCreateButton("OK", 10, 30, 50)
GUICtrlSetOnEvent(-1, "OKPressed")

GUICtrlCreateButton("Cancel", 0, -1)
GUICtrlSetOnEvent(-1, "CancelPressed")

GUISetState(@SW_HIDE)

EndFunc   ;==>Example
Func OKPressed()
MsgBox(0, "OK Pressed", "ID=" & @GUI_CtrlId & " WinHandle=" & @GUI_WinHandle & " CtrlHandle=" & @GUI_CtrlHandle)
EndFunc   ;==>OKPressed
Func CancelPressed()
MsgBox(0, "Cancel Pressed", "ID=" & @GUI_CtrlId & " WinHandle=" & @GUI_WinHandle & " CtrlHandle=" & @GUI_CtrlHandle)
EndFunc   ;==>CancelPressed

Share this post


Link to post
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
Sign in to follow this  

×