muncherw Posted July 16, 2009 Posted July 16, 2009 I'd like some items in a combo box to have a slightly different background color from each other. I know this can't be done with any normal means but I saw someone do this with 3 or 4 weeks ago with listview items (I can't find the thread now though) and wondered if anyone had tried something similar for combobox items. Not to be confused with alternating list items. Other People's Stuff:Andy Flesner's AutoIt v3: Your Quick Guide[topic="34302"]Locodarwin's ExcelCom_UDF[/topic][topic="61090"]MrCreatorR's Opera Library[/topic]
Moderators Melba23 Posted July 16, 2009 Moderators Posted July 16, 2009 muncherw, The listview colouring UDF is here. I have not seen anything about colouring combos, sorry. 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
muncherw Posted July 16, 2009 Author Posted July 16, 2009 muncherw, The listview colouring UDF is here. I have not seen anything about colouring combos, sorry. M23 Thanks, Melba23. Other People's Stuff:Andy Flesner's AutoIt v3: Your Quick Guide[topic="34302"]Locodarwin's ExcelCom_UDF[/topic][topic="61090"]MrCreatorR's Opera Library[/topic]
ReFran Posted July 16, 2009 Posted July 16, 2009 Not exactly, but maybe it helps. br, Reinhard ;; example written from ProgAndy #include <GuiComboBoxEx.au3> #include <GuiImageList.au3> #include <GuiConstantsEx.au3> Opt('MustDeclareVars', 1) $Debug_CB = False ; Check ClassName being passed to ComboBox/ComboBoxEx functions, set to True and use a handle to another control to see it work Global $iMemo _Main() Func _Main() Local $hGUI, $hImage, $hCombo,$bmp ; Create GUI $hGUI = GUICreate("ComboBoxEx Set Image List", 400, 300) $hCombo = _GUICtrlComboBoxEx_Create ($hGUI, "", 2, 2, 394, 100) $iMemo = GUICtrlCreateEdit("", 2, 32, 396, 266, 0) GUICtrlSetFont($iMemo, 9, 400, 0, "Courier New") GUISetState() $hImage = _GUIImageList_Create (20, 12, 5, 3) Local $List[7][2] = [ _ ["ROT",0xFF0000] , _ ["Grün",0x00FF00] , _ ["Blau",0x0000FF] , _ ["Gelb",0xFFFF00] , _ ["cyan",0x00FFFF] , _ ["Weiß",0xFFFFFF] , _ ["Schwarz",0x000000] ] ;Set Image List _GUICtrlComboBoxEx_SetImageList ($hCombo, $hImage) ; Add Items For $i = 0 To UBound($List)-1 $bmp = _IMGListAddColor($hImage,$List[$i][1],20,12) _GUICtrlComboBoxEx_AddString ($hCombo, $List[$i][0], $bmp, $bmp) Next Do Until GUIGetMsg() = $GUI_EVENT_CLOSE EndFunc ;==>_Main ; Prog@ndy Func _IMGListAddColor($hImage,$Color,$W=16,$H=16) Local $bmp = _WinAPI_CreateSolidBitMap (_WinAPI_GetDesktopWindow(), $Color,$W,$H) Local $index = _GUIImageList_Add ($hImage,$bmp) _WinAPI_DeleteObject($bmp) Return $index EndFunc
muncherw Posted July 16, 2009 Author Posted July 16, 2009 Not exactly, but maybe it helps.br, ReinhardWon't look like what I had envisioned but may serve the purpose just as well. Thanks. Other People's Stuff:Andy Flesner's AutoIt v3: Your Quick Guide[topic="34302"]Locodarwin's ExcelCom_UDF[/topic][topic="61090"]MrCreatorR's Opera Library[/topic]
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