TommyDDR Posted January 12, 2012 Share Posted January 12, 2012 (edited) Hi, I just try to create a slider and change his background color and realise that GUICtrlSetBkColor on a slider put the focus on the windows of that slider. I would like to know if that is a bug or normal effect of GUICtrlSetBkColor. If you want to try this : #include <GUIConstantsEx.au3> Opt("GUIOnEventMode", 1) Dim $Gui $Gui = GUICreate("test", 300, 300) $test = GUICtrlCreateSlider(10, 10, 280, 20) GUICtrlSetBkColor($test, 0xFFFFFF) GUISetOnEvent($GUI_EVENT_CLOSE, "quit") GUISetState(@SW_SHOWNA) While(True) Sleep(10) WEnd Func quit() Exit EndFunc Thanks Edited January 12, 2012 by TommyDDR _GUIRegisterMsg (Register more than 1 time the same Msg), _Resize_Window (GUICtrlSetResizing for children windows), _GUICtrlSetOnHover (Link a function when mouse go on, left, clic down, clic up, on a control), _InputHeure (Create an input for hour contain), _GUICtrlCalendar (Make a complete calendar), _GUICtrlCreateGraphic3D (Create a 3D graph), _ArrayEx.au3 (Array management), _GUIXViewEx.au3 (List/Tree View management). Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 12, 2012 Moderators Share Posted January 12, 2012 TommyDDR,I think what you are seeing is not the result of GUICtrlSetBkColor specifically, but the unwelcome application of the WM_SETFOCUS message to the slider control. Take a look at the NoFocusLines UDF in my sig for more info on this - and how to prevent it. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
TommyDDR Posted January 28, 2012 Author Share Posted January 28, 2012 (edited) Thank's for your answer, i've try to use your code but no result... #include <GUIConstantsEx.au3> #include "NoFocusLines.au3" Opt("GUIOnEventMode", 1) Dim $Gui $Gui = GUICreate("test", 300, 300) $Slider = GUICtrlCreateSlider(10, 10, 280, 20) GUISetOnEvent($GUI_EVENT_CLOSE, "quit") GUISetState(@SW_SHOWNA) ConsoleWrite(_NoFocusLines_Set($Slider) & @CRLF) Sleep(1000) GUICtrlSetBkColor($Slider, 0xFF0000) While(True) Sleep(10) WEnd Func quit() Exit EndFunc Edited January 28, 2012 by TommyDDR _GUIRegisterMsg (Register more than 1 time the same Msg), _Resize_Window (GUICtrlSetResizing for children windows), _GUICtrlSetOnHover (Link a function when mouse go on, left, clic down, clic up, on a control), _InputHeure (Create an input for hour contain), _GUICtrlCalendar (Make a complete calendar), _GUICtrlCreateGraphic3D (Create a 3D graph), _ArrayEx.au3 (Array management), _GUIXViewEx.au3 (List/Tree View management). Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 28, 2012 Moderators Share Posted January 28, 2012 TommyDDR,I know that colouring buttons makes them behave strangely because of a bug deep within the core AutoIt code - it looks like you have found another problem with the way colouring controls was implemented. You might want to raise a Trac ticket for it, but I fear the answer will be the same as for the button - "too difficult to fix". Sorry not to be of more help - do you have to colour the slider? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
TommyDDR Posted January 28, 2012 Author Share Posted January 28, 2012 (edited) I have a slider in a tab item but the background of the slider is same as the background of the windows (not same as the tab item), so i change bkcolor of slider (yes, it's messy, but i don't find another way). Thank you for yours replies Edited January 28, 2012 by TommyDDR _GUIRegisterMsg (Register more than 1 time the same Msg), _Resize_Window (GUICtrlSetResizing for children windows), _GUICtrlSetOnHover (Link a function when mouse go on, left, clic down, clic up, on a control), _InputHeure (Create an input for hour contain), _GUICtrlCalendar (Make a complete calendar), _GUICtrlCreateGraphic3D (Create a 3D graph), _ArrayEx.au3 (Array management), _GUIXViewEx.au3 (List/Tree View management). 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