I have a control which hosts a NumericUpDown
in a ToolStripControlHost
and exposes the NumericUpDown
's properties. Functionally, that's fine, but when it's placed on a ToolStrip
it doesn't fit visually with the other ToolStripItem
s.
I'd like to use the ToolStrip
's existing ToolStripRenderer
to draw the control in a manner similar to the ToolStripComboBox
es that are also on the control. I'm not interested in creating a custom ToolStripRenderer
to do that, as I want others who use the control to be able to use it with whichever renderer they choose.
I've tried overriding OnPaint
and OnPaintBackground
in the hosting control class, and in the hosted control class, and using the renderer's drawing methods, but all I can achieve is to have an unpainted region around the edges; the spin buttons are still drawn with the system theme.
How do I paint a hosted NumericUpDown
using the existing ToolStripRenderer
?