nend Posted January 13, 2016 Share Posted January 13, 2016 (edited) Hello, Is it possible to change the color of a slider control? In my windows (wndows 10) it's blue (see the screenshot) and that's the thing I want to be a different color. I'v try'd it with serveral options such as: - GUICtrlSetColor - GUICtrlSetBkColor But no changes in color. Does anyone has any idea? #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> Example() Func Example() GUICreate("slider", 220, 100, 100, 200) Local $idSlider1 = GUICtrlCreateSlider(10, 10, 200, 40) GUICtrlSetColor (-1, 0x808080) GUICtrlSetLimit(-1, 200, 0) ; change min/max value Local $idButton = GUICtrlCreateButton("Value?", 75, 70, 70, 20) GUISetState(@SW_SHOW) GUICtrlSetData($idSlider1, 45) ; set cursor Local $idMsg ; Loop until the user exits. Do $idMsg = GUIGetMsg() If $idMsg = $idButton Then MsgBox($MB_SYSTEMMODAL, "slider1", GUICtrlRead($idSlider1), 2) EndIf Until $idMsg = $GUI_EVENT_CLOSE EndFunc ;==>Example Edited January 24, 2016 by nend Link to comment Share on other sites More sharing options...
spudw2k Posted January 14, 2016 Share Posted January 14, 2016 No clue, but I did come across this as a potential alternative. Might be worth checking out as an interim if customizing the slider appearance is essential. Of course someone else may chime in with a method to actually color the standard control..... Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX BuilderMisc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retreive SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose ArrayProjects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalcCool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
nend Posted January 15, 2016 Author Share Posted January 15, 2016 No clue, but I did come across this as a potential alternative. Might be worth checking out as an interim if customizing the slider appearance is essential. Of course someone else may chime in with a method to actually color the standard control..... Thanks for the tip, I'll wil look into it. Link to comment Share on other sites More sharing options...
Danyfirex Posted January 16, 2016 Share Posted January 16, 2016 This can help. Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
xroot Posted January 16, 2016 Share Posted January 16, 2016 You might try this, it works in Win7 not sure about 10? #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> Global Const $WM_CTLCOLORSTATIC = 0x0138 Example() Func Example() global $iBursh = DllCall("gdi32.dll","hwnd","CreateSolidBrush","dword",0x808080) GUICreate("slider", 220, 100, 100, 200) Local $idSlider1 = GUICtrlCreateSlider(10, 10, 200, 40) ;GUICtrlSetColor (-1, 0x808080) GUICtrlSetLimit(-1, 200, 0) ; change min/max value Local $idButton = GUICtrlCreateButton("Value?", 75, 70, 70, 20) GUICtrlSetData($idSlider1, 45) ; set cursor GUIRegisterMsg($WM_CTLCOLORSTATIC,"WM_CTLCOLORSTATIC") GUISetState(@SW_SHOW) Local $idMsg ; Loop until the user exits. Do $idMsg = GUIGetMsg() If $idMsg = $idButton Then MsgBox($MB_SYSTEMMODAL, "slider1", GUICtrlRead($idSlider1), 2) EndIf Until $idMsg = $GUI_EVENT_CLOSE EndFunc ;==>Example Func WM_CTLCOLORSTATIC($hWin,$uMsg,$wParam,$lParam) return $iBursh[0] EndFunc Link to comment Share on other sites More sharing options...
nend Posted January 23, 2016 Author Share Posted January 23, 2016 On 16-1-2016 at 4:49 PM, xroot said: You might try this, it works in Win7 not sure about 10? #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> Global Const $WM_CTLCOLORSTATIC = 0x0138 Example() Func Example() global $iBursh = DllCall("gdi32.dll","hwnd","CreateSolidBrush","dword",0x808080) GUICreate("slider", 220, 100, 100, 200) Local $idSlider1 = GUICtrlCreateSlider(10, 10, 200, 40) ;GUICtrlSetColor (-1, 0x808080) GUICtrlSetLimit(-1, 200, 0) ; change min/max value Local $idButton = GUICtrlCreateButton("Value?", 75, 70, 70, 20) GUICtrlSetData($idSlider1, 45) ; set cursor GUIRegisterMsg($WM_CTLCOLORSTATIC,"WM_CTLCOLORSTATIC") GUISetState(@SW_SHOW) Local $idMsg ; Loop until the user exits. Do $idMsg = GUIGetMsg() If $idMsg = $idButton Then MsgBox($MB_SYSTEMMODAL, "slider1", GUICtrlRead($idSlider1), 2) EndIf Until $idMsg = $GUI_EVENT_CLOSE EndFunc ;==>Example Func WM_CTLCOLORSTATIC($hWin,$uMsg,$wParam,$lParam) return $iBursh[0] EndFunc I've tryd this but only the background get painted on windows 10. I don't think this is possible. Link to comment Share on other sites More sharing options...
nend Posted January 23, 2016 Author Share Posted January 23, 2016 On 16-1-2016 at 1:21 PM, Danyfirex said: This can help. Saludos Thanks I've taken the gdi+ slider from UEZ, It's amazing what this person can do with gdi+ 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