I have an owner control where I need to draw the extension (plus / minus) window of the tree. With the visual style enabled, it's simple, just create a visualizer for the corresponding VisualStyleElement object:
VisualStyleElement element = VisualStyleElement.TreeView.Glyph.Opened VisualStyleRenderer renderer = new VisualStyleRenderer( element ); Size size = renderer.GetPartSize( graphics, ThemeSizeType.True ); ... renderer.DrawBackground( graphics, someRect );
Is it possible to achieve a similar effect when disabling visual styles? I know that there is a ControlPaint class that can draw whole controls, but how to draw (and get the size) only part of the TreeView control?
source share