cmattb 1 Posted August 7, 2007 So in my program, I have a button that needs to be one of 3 colors. The default, blue, or gray. throughout the program, the button changes colors depending on whats going on. I need to be able to change it back to default colors, but i can't figure it out. Ive tried setting it to transparent, but that didnt work. Is there some variable for setting GUICtrlSetBkColor to default, or to delete the old GUICtrlSetBkColor's? Sorta Example code below. Isnt what the code is, but same application #include <guiconstants.au3> $gui1 = GUICreate("button", 150,150) $button = GuiCtrlCreateButton("Button!", 50, 50,50,50) GUISetState () While 1 Sleep(2000) GUICtrlSetBkColor($button,0x99CCFF); Blue Sleep(2000) GUICtrlSetBkColor($button,0x999999); gray Sleep(2000) GUICtrlSetBkColor($button,0xFFFFFF); back to default, or delete old colors. WEnd Share this post Link to post Share on other sites
Zedna 292 Posted August 7, 2007 (edited) Try Global Const $GUI_BKCOLOR_DEFAULT = -1not tested.EDIT:Maybe try:Const $COLOR_BTNFACE = 15 Edited August 7, 2007 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Share this post Link to post Share on other sites
cmattb 1 Posted August 7, 2007 Sorry, I dont really get it. How would I use this exactually in the code above. Keep in mind that this can only affect this one button, not every button in the script. Thanks Share this post Link to post Share on other sites
cmattb 1 Posted August 7, 2007 0xECE9D8 makes the button a kinda Beige color, but doesnt set it back to default. By default, the button is a multi-shade deal, light at the top, and darker at the bottom. You'de think something like this would be easy, but this has caused me more rustration than anything else in this project so far, lol. Share this post Link to post Share on other sites
martin 85 Posted August 7, 2007 (edited) So in my program, I have a button that needs to be one of 3 colors. The default, blue, or gray. throughout the program, the button changes colors depending on whats going on. I need to be able to change it back to default colors, but i can't figure it out. Ive tried setting it to transparent, but that didnt work. Is there some variable for setting GUICtrlSetBkColor to default, or to delete the old GUICtrlSetBkColor's? Sorta Example code below. Isnt what the code is, but same application #include <guiconstants.au3> $gui1 = GUICreate("button", 150,150) $button = GuiCtrlCreateButton("Button!", 50, 50,50,50) GUISetState () While 1 Sleep(2000) GUICtrlSetBkColor($button,0x99CCFF); Blue Sleep(2000) GUICtrlSetBkColor($button,0x999999); gray Sleep(2000) GUICtrlSetBkColor($button,0xFFFFFF); back to default, or delete old colors. WEnd I don't know the answer, but if you're desperate this is what I would do (I have no pride) GuiCtrlDelete($button) $button = guiCtrlCreateButton(.... etc Edited August 7, 2007 by martin Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Share this post Link to post Share on other sites
Valuater 130 Posted August 8, 2007 Might want to take a look at EzSkinhttp://www.autoitscript.com/forum/index.ph...st&p=3073808) Share this post Link to post Share on other sites
cmattb 1 Posted August 8, 2007 Yea, Martin, that works great. Kinda annoying that you have to delete-then re-creat the button, but whatever. As long as it works. Thanks again! Share this post Link to post Share on other sites