I have a usercontrol that inherits from a DataGridView. I have overridden OnRowPrePaint, OnRowPostPaint, OnCellPaint, and some others so I can draw the entire thing as I want. Everything works beautifully, except the scrollbars. How can I intercept the scrollbars being painted and paint my own?
Ideally there is some datastructure that contains the bounds for the scroll bar itself as well as the bounds for actually scroll-slider. Then I can just draw on the graphics layer at those locations.
Is there a way to do this? It seems like everything else was though of, so I would imagine there is some way to do it…
When inheriting from the scrollbar class, add this to Sub New:
The OnPaint event will now fire.
To override the standard buttons / slider from being drawn when clicking the control:
And to reduce the flicker:
EDIT:
I clearly need to learn to read.
Didn’t notice the
bit……..