a_jam_sandwich
Junior Contributor
Right the following code works to a point.
Looks great but when changing combobox.text to a text item in the list it will not be visable unless the control gets focus and you pull the dropdown down.
Any ideas?
Andy
Visual Basic:
Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
MyBase.WndProc(m)
Select Case m.Msg
Case &HF
Dim e As Graphics = Me.CreateGraphics
Dim bgBrush As New SolidBrush(Me.BackColor)
Dim boxBrush As New SolidBrush(SystemColors.Control)
Dim arrowBrush As New SolidBrush(Color.Black)
Dim arrowBrushSelected As New SolidBrush(SystemColors.Highlight)
e.FillRectangle(bgBrush, e.ClipBounds)
Dim rect As Rectangle = New Rectangle(Me.Width - 19, 3, 15, Me.Height - 6)
e.FillRectangle(boxBrush, rect)
Dim pth As Drawing2D.GraphicsPath = New Drawing2D.GraphicsPath()
Dim TopLeft As PointF = New PointF(Me.Width - 16, (Me.Height - 5) / 2)
Dim TopRight As PointF = New PointF(Me.Width - 8, (Me.Height - 5) / 2)
Dim Bottom As PointF = New PointF(Me.Width - 12, (Me.Height + 2) / 2)
pth.AddLine(TopLeft, TopRight)
pth.AddLine(TopRight, Bottom)
e.SmoothingMode = Drawing2D.SmoothingMode.AntiAlias
e.FillPath(arrowBrush, pth)
ControlPaint.DrawBorder(e, ClientRectangle, Color.Black, ButtonBorderStyle.Solid)
End Select
End Sub
Looks great but when changing combobox.text to a text item in the list it will not be visable unless the control gets focus and you pull the dropdown down.
Any ideas?
Andy