Hi Igor
Was going to ask a "how do I ..." question when I realised that I could make it happen ... myself.
The question was: "How can I set the foreground and background colours of a combobox item list?"
Well, I added these properties to the oODCombo object(with the US spelling "color"): hope that you don't mind. I did it thus;
In the Class Module "cODCombo"
1. I added 2 private variables and 2 properties
Private m_lForeColor As Long
Private m_lBackColor As Long
Public Property Let ForeColor(ByVal lColor As Long)
m_lForeColor = lColor
End Property
Public Property Get ForeColor() As Long
ForeColor = m_lForeColor
End Property
Public Property Let BackColor(ByVal lColor As Long)
m_lBackColor = lColor
End Property
Public Property Get BackColor() As Long
BackColor = m_lBackColor
End Property
2. I changed the Class_Initialize so that we have the usual defaults (that you had in your code)
Private Sub Class_Initialize()
' Default values
m_lHeight = 120
m_lWidth = 0 ' Width equals column width
m_lMaxItemHeight = MIN_ITEM_HEIGHT
m_lMaxHeightInItems = DEFAULT_MAX_HEIGHT_IN_ITEMS
m_bAutoExpand = True
m_lForeColor = GetSysColor(COLOR_WINDOWTEXT)
m_lBackColor = GetSysColor(COLOR_WINDOW)
End Sub
3. Finally I changed the Function plDrawItem thus - kept the old values for good measure :)
If bSelected Then
hBrush = GetSysColorBrush(COLOR_HIGHLIGHT)
lBkColor = GetSysColor(COLOR_HIGHLIGHT)
lTxtColor = GetSysColor(COLOR_HIGHLIGHTTEXT)
Else
hBrush = m_lBackColor 'GetSysColorBrush(COLOR_WINDOW)
lBkColor = m_lBackColor '= GetSysColor(COLOR_WINDOW)
lTxtColor = m_lForeColor '= GetSysColor(COLOR_WINDOWTEXT) '
End If
Next in Class ComboObject I added the following 2 properties
Public Property Let ForeColor(lForeColor As Long)
m_objCbo.ForeColor = lForeColor
End Property
Public Property Get ForeColor() As Long
ForeColor = m_objCbo.ForeColor
End Property
Public Property Let BackColor(lBackColor As Long)
m_objCbo.BackColor = lBackColor
End Property
Public Property Get BackColor() As Long
BackColor = m_objCbo.BackColor
End Property
And there it is! Combos now have fore colour and if you really want to ... back colour.
and as a code sample, it looks like this
With .Combos("DoseInterval")
Set .Font = ComboFnt
.ForeColor = vbRed
.BackColor = vbYellow
.AutoAdjustWidth
End With

Click to View Image140 View(s)
But I'm left feeling a bit empty. You see I would rather see the back colour of the combobox container set to the back colour of the cell containing the combobox and not just the text of each item: it would look neater. Problem is, I'm stumped as to how to do this.
In ShowDropDown of oODCombo I tried setting the back colour after you call showdropdown but it doesn't do what I want.
SendMessageByLongW m_hWnd, CB_SHOWDROPDOWN, 1, 0
SetBkColor m_hWnd, m_lBackColor '<--- or any colour, really
Oh well, this has achieved what I wanted so I'm not whinging.
Cheers
Ciaran