Control Alpha Coloring

  • Thread starter Thread starter jp2msft
  • Start date Start date
J

jp2msft

I am trying to set the Alpha value for a Control Color in a very simple way,
but it is not working. I wanted the forum's input as to if my technique can
be done or if I am simply not doing it incorrectly.

I am experimenting with a Panel Control that is placed on a Windows Form
(.NET Framework 2.0 & VS2005).

To make the Panel transparent, I have added this short line of code:

private void Button1_Click(object sender, EventArgs e)
{
Panel1.BackColor = Color.FromArgb(50, Color.White);
}

Are there flaws in this simple logic?

Must I use the Graphics object to set the BackColor?

Using the code above, the Control's BackColor remains at 100% opacity, which
is *not* what I want.

Thanks for your input,
Joe
 
Thanks Mr. Duniho.

Not the answer I wanted, but that confirms what I was worried about.

We don't have WPF here yet, so I was attempting to fabricate a WPF
"look-alike".

Oh well.

~Joe
 
Back
Top