Micha1405 Posted May 25, 2006 Share Posted May 25, 2006 #include <GUIConstants.au3> GUICreate("Test",300,300) $Button1=GUICtrlCreateButton("Icon",10,20,35,35,$BS_ICON) GUICtrlSetImage($button1,"shell32.dll",22) $Button2=GUICtrlCreateButton("Reset Icon",10,80) GUISetState() while 1 $Msg = GUIGetMsg() Select Case $Msg=$button1 ;Reset Icon ???? How Display Plain Button Case $Msg=$GUI_EVENT_CLOSE Exit EndSelect WEnd My TrayToolBar Link to comment Share on other sites More sharing options...
ChrisL Posted May 25, 2006 Share Posted May 25, 2006 I assume you meant when you press button2 GUICreate("Test",300,300) $Button1=GUICtrlCreateButton("Icon",10,20,35,35,$BS_ICON) GUICtrlSetImage($button1,"shell32.dll",22) $Button2=GUICtrlCreateButton("Reset Icon",10,80) GUISetState() while 1 $Msg = GUIGetMsg() Select Case $Msg=$button2 ;Reset Icon ???? How Display Plain Button GuiCtrlSetState ($button1,$GUI_HIDE) GuiCtrlDelete($button1) $Button1=GUICtrlCreateButton("Icon",10,20,35,35,$BS_ICON) GuiCtrlSetState ($button1,$GUI_SHOW) Case $Msg=$GUI_EVENT_CLOSE Exit EndSelect WEnd [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted May 25, 2006 Moderators Share Posted May 25, 2006 (edited) Does this work for you?#include <GUIConstants.au3> GUICreate("Test",300,300) $Button1=GUICtrlCreateButton("Icon",10,20,35,35,$BS_ICON) GUICtrlSetImage($Button1,"shell32.dll",22) $Button2=GUICtrlCreateButton("Reset Icon",10,80) GUISetState() While 1 $Msg = GUIGetMsg() Select Case $Msg=$Button1 ;Reset Icon ???? How Display Plain Button GUICtrlSetImage($Button1, 'shell32.dll', 49, $BS_ICON) Case $Msg=$GUI_EVENT_CLOSE Exit EndSelect WEnd Edited May 25, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
ChrisL Posted May 25, 2006 Share Posted May 25, 2006 Does this work for you? Much better than my idea! [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
Micha1405 Posted May 25, 2006 Author Share Posted May 25, 2006 Thanks thats it but i see the change on button when i clicked How to refresh ? My TrayToolBar Link to comment Share on other sites More sharing options...
ChrisL Posted May 25, 2006 Share Posted May 25, 2006 Thanks thats it but i see the change on button when i clicked How to refresh ?Sorry, don't understand what your after [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
Micha1405 Posted May 25, 2006 Author Share Posted May 25, 2006 i click on button2 and nothing seems to happen, if i click on button 1 then icon changed to plain button sorry for bad english My TrayToolBar Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted May 25, 2006 Moderators Share Posted May 25, 2006 (edited) You have to tell it to do something, your only telling the Case statement to check Button1 not Button2? Edit:#include <GUIConstants.au3> GUICreate("Test",300,300) $Button1=GUICtrlCreateButton("Icon",10,20,35,35,$BS_ICON) GUICtrlSetImage($Button1,"shell32.dll",22) $Button2=GUICtrlCreateButton("Reset Icon",10,80) GUISetState() While 1 $Msg = GUIGetMsg() Select Case $Msg = $Button2 ;Reset Icon ???? How Display Plain Button GUICtrlSetImage($Button1, 'shell32.dll', 49, $BS_ICON) Case $Msg = $GUI_EVENT_CLOSE Exit EndSelect WEndIs that what your after? Look at the $Buttons, the case checks to see if $Button2 is clicked, and then changes $Button1 Edited May 25, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Micha1405 Posted May 25, 2006 Author Share Posted May 25, 2006 Thanks very much ! That is what i want My TrayToolBar Link to comment Share on other sites More sharing options...
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