Jump to content

GUICtrlSetOnEvent - 2GUI + Function


Recommended Posts

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
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...