I have a tab-based application for windows, which I am developing by myself.
I would like to add a subtle gradient to the background of my tab control. How would I go around doing this? What is the best method for me to use?
I think that implementing a custom control that takes up the space of the tab control would work, but how would I then draw a gradient using GDI?
To use GDI you’ll need the GradientFill function. You can also use GDI+ to get gradients. Here’s a plain GDI example:
As for the tab control, you could sub-class the control and override its non-client and client drawing handlers to render the gradient.
To sub class a control, first create the control and then replace its WNDPROC function:
then, in your new WNDPROC: