Jump to content

GuiCtrlSetBKColor default value?


cmattb
 Share

Recommended Posts

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
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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