Knight Posted April 2, 2010 Share Posted April 2, 2010 Hi, I did a quick search and was unable to find anything, perhaps my keywords were no good. I have scripted an application that will change a Label's BK color to green when a button is pressed and all works fine. Now I would like to be able to set the Bk color back to default later in the script. I figure I could just delete the label and re-write it, but I was hoping there was a better way. Any help is much appreciated. Link to comment Share on other sites More sharing options...
KaFu Posted April 2, 2010 Share Posted April 2, 2010 Upsa, misread that you search for guibkcolor... left both gui and ctrl bk color examples in ... #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <WinAPI.au3> #include <StaticConstants.au3> Local $msg GUICreate("My GUI") ; will create a dialog box that when displayed is centered GUISetBkColor(0x00ff00) $label = GUICtrlCreateLabel("Test",10,10,200) GUICtrlSetBkColor(-1,0x0000ff) GUISetState(@SW_SHOW) ; will display an empty dialog box Sleep(2000) GUISetBkColor(_GetSysColor(15)) GUICtrlSetBkColor($label,_GetSysColor(15)) While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd GUIDelete() Func _RGB2BGR($nColor) Return (BitAND($nColor, 0xff) * 0x10000) + BitAND($nColor, 0xff00) + (BitAND($nColor, 0xff0000) / 0x10000) EndFunc ;==>_RGB2BGR Func _GetSysColor($nIndex) Return _RGB2BGR(_WinAPI_GetSysColor($nIndex)) EndFunc ;==>_GetSysColor AnonymousX and Professor_Bernd 2 OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
Knight Posted April 2, 2010 Author Share Posted April 2, 2010 Upsa, misread that you search for guibkcolor... left both gui and ctrl bk color examples in ... .. Works great. Thanks a lot KaFu. 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