Tankbuster Posted February 23, 2010 Posted February 23, 2010 I searched the forum and the doc but somehow I was unable to get an idea if there is an option (or workarround) to set the color of the border of a combobox? With GUICtrlSetColor and GUICtrlSetBkColor I'm able to set the font color and background inside the control but there is a small border around the control. It looks like this color is under control by the OS. #include <GuiComboBoxEx.au3> #include <GuiConstantsEx.au3> Opt('MustDeclareVars', 1) _Main() Func _Main() Local $hGUI, $hImage, $hCombo ; Create GUI $hGUI = GUICreate("ComboBoxEx color test", 200, 200) GUISetBkColor(0x000000) $hCombo = GUICtrlCreateCombo("text", 2, 2, 150, 190) GUICtrlSetColor($hCombo,0xFFFFFF) GUICtrlSetBkColor($hCombo, 0x000000) GUISetState() Do Until GUIGetMsg() = $GUI_EVENT_CLOSE EndFunc ;==>_ Did I missed something on the docu? If this is somewhere else already solved please post the link to the thread. Thank you very much.
Moderators Melba23 Posted February 23, 2010 Moderators Posted February 23, 2010 Tankbuster,Those colours are, to the best of my knowledge, set by the system and can therefore only be changed on a systemwide basis. You can find out what they are currently by using _WinAPI_GetSysColor and you can change them by using _WinAPI_SetSysColors. You would probably need to change these elements:$COLOR_3DHILIGHT - Highlight color for three-dimensional display elements (for edges facing the light source.) $COLOR_3DLIGHT - Light color for three-dimensional display elements (for edges facing the light source.) $COLOR_3DSHADOW - Shadow color for three-dimensional display elements (for edges facing away from the light source).However, you would also change them for every other GUI on the machine, which might not be what you want. M23P.S. I have found that on my Vista machine they reset to the default colours on reboot, by the way, so if it all gets out of hand you can (probably) recover the original colours at the cost of a few minutes wait. 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
Tankbuster Posted February 23, 2010 Author Posted February 23, 2010 _WinAPI_GetSysColor and you can change them by using _WinAPI_SetSysColors. ....However, you would also change them for every other GUI on the machine, which might not be what you want. With your hint I search the docu and there is an example but this does not work on my XP PC. I will try it on my Win7 PC....But as you stated I will change all other GUIs too, so I will ruin a lot :-(But thx for the first idea.Question: I ran in the docu sometimes over the phrase " painted if the "Windows XP/Vista style" is used." - Is it somehow related to the GUI "basic" look and feel and somehow attached to this question?See GUICtrlSetColor in the docu (on the remarks).
Moderators Melba23 Posted February 23, 2010 Moderators Posted February 23, 2010 Tankbuster, Take a look here - I answered a similar question recently. 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
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