How to grayscale a complete Form..?

Hi Experts,
my actual problem is, that I've no plan, how to get the above result. The background: I have an indvidual colored MainForm with some colored content (eg. buttons or toolbars). I'd like, to grayscale this complete form every time, when there is showing a smaller, modal form in the front and to color it back after closing it. Can U help ?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

One idea would be to have a procedure that is called when the form looses focus, this function runs though all of the components and copies the color to the componenets tag property, then changes the colour to clBtnFace, then when the form bemoces active again it reverses the process.
Something like

  li: integer;
  for li:=0 to pred(Controlcount) do
    if Controls[li] is TPanel then
      Controls[li].Tag:=(Controls[li] as TPanel).Color;
      (Controls[li] as TPanel).Color:=clBtnFace;
  for li:=0 to pred(Controlcount) do
    if Controls[li] is TPanel then
      (Controls[li] as TPanel).Color:=Controls[li].Tag;

simplified code compared to what you might need, unfortunatley the color property is protected in TControl so you have to be a bit more specific about the controls


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Brainwashed2Author Commented:
Thanks  pcsentinel ! That's exactly what I needed.  

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.