I would like to draw a gradient rectangle that uses
the same two colors that Windows uses to paint
the active caption bar.
ActiveCaption is one color. Does anyone know how
to find the color at the other end of the gradient?

Signature
Tony M.
Chris Jobson - 11 Sep 2005 15:19 GMT
>I would like to draw a gradient rectangle that uses
> the same two colors that Windows uses to paint
> the active caption bar.
>
> ActiveCaption is one color. Does anyone know how
> to find the color at the other end of the gradient?
I don't know any ".Net" way to do this, but you can use P/Invoke to call the
WinApi function GetSysColor(COLOR_GRADIENTACTIVECAPTION). Unless you're
certain that the captions use gradients, you ought to check by calling the
Api function SystemParametersInfo passing the value SPI_GETGRADIENTCAPTIONS.
If you need more help I can supply some C++ code that does this - but I'm
not sure of the details of calling WinApi functions from .Net code.
Chris Jobson
Lloyd Dupont - 12 Sep 2005 06:34 GMT
check out these articles on code project:
http://www.codeproject.com/cs/miscctrl/xp-style_button.asp
http://www.codeproject.com/vb/net/XPStyleB.asp
>I would like to draw a gradient rectangle that uses
> the same two colors that Windows uses to paint
> the active caption bar.
>
> ActiveCaption is one color. Does anyone know how
> to find the color at the other end of the gradient?