Control Alpha Coloring

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
 
J

jp2msft

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top