I am using a custom renderer to change the highlilght color dor a ToolStrip Split button (code below). It works and the highlighted color is indeed changed, the problem is when highlighted it does not draw the arrow. I have tried calling MyBase.MyBase.OnRenderArrow() and also MyBase.DrawArrow() but neither seems to draw the arrow. Maybe I am creating the graphics object incorrectly or something.
This works fine, and the arrow is drawn on a plain ToolStrip DropDownButton but just not the Split button for some reason.
Any other suggestions to get the arrow drawn from a custom renderer?
Why is the Arrow not getting drawn in the first place?
This works fine, and the arrow is drawn on a plain ToolStrip DropDownButton but just not the Split button for some reason.
Any other suggestions to get the arrow drawn from a custom renderer?
Why is the Arrow not getting drawn in the first place?
vb.net Code:
Private Class MyRenderer : Inherits ToolStripProfessionalRenderer Protected Overrides Sub OnRenderSplitButtonBackground(ByVal e As System.Windows.Forms.ToolStripItemRenderEventArgs) If e.Item.Selected Then Dim rc As New Rectangle(Point.Empty, e.Item.Size) 'Set the highlight color e.Graphics.FillRectangle(Brushes.Gainsboro, rc) e.Graphics.DrawRectangle(Pens.Gainsboro, 1, 0, rc.Width - 2, rc.Height - 1) Else MyBase.OnRenderSplitButtonBackground(e) End If End Sub End Class