NoHAX Posted January 2, 2011 Posted January 2, 2011 (edited) Yep, i dont want to cover button by some image.jpg file to make him like invisible i want "cameleon" button Edited January 2, 2011 by NoHAX
NoHAX Posted January 2, 2011 Author Posted January 2, 2011 Ehm but this must be clickable, i dont think there is event "onclick" for labels
Valuater Posted January 2, 2011 Posted January 2, 2011 Cut-up from help file.. expandcollapse popup#include <GUIConstantsEx.au3> Opt('MustDeclareVars', 1) Example() Func Example() Local $parent1, $ok1, $cancel1 Opt("GUICoordMode", 2) Opt("GUIResizeMode", 1) Opt("GUIOnEventMode", 1) $parent1 = GUICreate("Parent1") GUISetOnEvent($GUI_EVENT_CLOSE, "SpecialEvents") GUISetOnEvent($GUI_EVENT_MINIMIZE, "SpecialEvents") GUISetOnEvent($GUI_EVENT_RESTORE, "SpecialEvents") $ok1 = GUICtrlCreateButton("OK", 10, 30, 50) GUICtrlSetOnEvent(-1, "OKPressed") $cancel1 = GUICtrlCreateLabel(" Cancel", 0, -1) GUICtrlSetOnEvent(-1, "CancelPressed") GUISetState(@SW_SHOW) ; Just idle around While 1 Sleep(10) WEnd 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 Func SpecialEvents() Select Case @GUI_CtrlId = $GUI_EVENT_CLOSE MsgBox(0, "Close Pressed", "ID=" & @GUI_CtrlId & " WinHandle=" & @GUI_WinHandle) Exit Case @GUI_CtrlId = $GUI_EVENT_MINIMIZE MsgBox(0, "Window Minimized", "ID=" & @GUI_CtrlId & " WinHandle=" & @GUI_WinHandle) Case @GUI_CtrlId = $GUI_EVENT_RESTORE MsgBox(0, "Window Restored", "ID=" & @GUI_CtrlId & " WinHandle=" & @GUI_WinHandle) EndSelect EndFunc ;==>SpecialEvents 8)
NoHAX Posted January 2, 2011 Author Posted January 2, 2011 Thx its working I tried with GUIgetMsg, but Event option is working, Thx a lot
Valuater Posted January 2, 2011 Posted January 2, 2011 GUIgetMsg() will work too! You said "on event" so that was the example I gave you. 8)
Valuater Posted January 2, 2011 Posted January 2, 2011 Yep... works with message #include <GUIConstantsEx.au3> Opt('MustDeclareVars', 1) Example() Func Example() Local $Button_1, $Button_2, $msg GUICreate("My GUI Button") ; will create a dialog box that when displayed is centered $Button_1 = GUICtrlCreateButton("Run Notepad", 10, 30, 100) $Button_2 = GUICtrlCreateLabel("Button Test", 20, 60) GUISetState() ; will display an dialog box with 2 button ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button_1 Run('Notepad.exe') ; Will Run/Open Notepad Case $msg = $Button_2 MsgBox(0, 'Testing', 'Button 2 was pressed') ; Will demonstrate Button 2 being pressed EndSelect WEnd EndFunc ;==>Example 8)
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