Я создал пользовательский элемент управления ComboBox. Основная цель - рендеринг в темном режиме. Мне удалось достичь большей части этого. Тем не менее, я застрял в том, как изменить раскрывающийся список автозаполнения (то есть применить цвета назад и вперед).
Вот проблема:
![enter image description here](https://i.stack.imgur.com/6g8OE.png)
Я изменяю рендеринг комбинированного списка с помощью этого кода:
Protected Overrides Sub WndProc(ByRef m As Message)
MyBase.WndProc(m)
Select Case m.Msg
Case &HF
Dim g As Graphics = Me.CreateGraphics
' Full Control Background
g.FillRectangle(_BorderBrush, Me.ClientRectangle)
If Me.DropDownStyle = ComboBoxStyle.DropDown Then
g.FillRectangle(New SolidBrush(Me.BackColor), _BorderWidth, _BorderWidth,
Me.Width - _ButtonWidth - (3 * _BorderWidth),
Me.ClientRectangle.Height - (2 * _BorderWidth))
' DropDown Button Background
Dim rect As Rectangle = New Rectangle(Me.Width - _ButtonWidth - _BorderWidth, _BorderWidth,
_ButtonWidth, Me.Height - (2 * _BorderWidth))
g.FillRectangle(_DropButtonBrush, rect)
ElseIf Me.DropDownStyle = ComboBoxStyle.DropDownList Then
g.FillRectangle(New SolidBrush(Me.BackColor), _BorderWidth, _BorderWidth,
Me.Width - (2 * _BorderWidth),
Me.ClientRectangle.Height - (2 * _BorderWidth))
End If
' Drop Down BUtton Arrow
Dim pth As Drawing2D.GraphicsPath = New Drawing2D.GraphicsPath()
Dim TopLeft As PointF = New PointF(Me.Width - _ButtonWidth - _BorderWidth + 2, (Me.Height - 5) / 2)
Dim TopRight As PointF = New PointF(Me.Width - 6, (Me.Height - 5) / 2)
Dim Bottom As PointF = New PointF(Me.Width - 9, (Me.Height + 2) / 2)
pth.AddLine(TopLeft, TopRight)
pth.AddLine(TopRight, Bottom)
g.SmoothingMode = Drawing2D.SmoothingMode.HighQuality
g.FillPath(_ArrowBrush, pth)
Case Else
Exit Select
End Select
End Sub
Я не полностью понимаю процесс WndPro c, но мне интересно, есть ли другой код для рендеринга выпадающего автозаполнения? Однако не знаете, как go найти эти коды.
Есть идеи?