NoHAX 1 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 Share this post Link to post Share on other sites
Valuater 130 Posted January 2, 2011 Just use a label... 8) Share this post Link to post Share on other sites
NoHAX 1 Posted January 2, 2011 Ehm but this must be clickable, i dont think there is event "onclick" for labels Share this post Link to post Share on other sites
Valuater 130 Posted January 2, 2011 Just try it, it will work 8) Share this post Link to post Share on other sites
Valuater 130 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) Share this post Link to post Share on other sites
NoHAX 1 Posted January 2, 2011 Thx its working I tried with GUIgetMsg, but Event option is working, Thx a lot Share this post Link to post Share on other sites
Valuater 130 Posted January 2, 2011 GUIgetMsg() will work too! You said "on event" so that was the example I gave you. 8) Share this post Link to post Share on other sites
Valuater 130 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) Share this post Link to post Share on other sites