Transparent background problem

D

David Veeneman

I have created several UserControls with transparent backgrounds. To enable
transparency, I've added the following statement to the constructor for each
control:

this.SetStyle(ControlStyles.SupportsTransparentBackColor, true);

On most of the controls, transpanency works fine. But on a couple of
controls, the transparent area is black. I tried adding this statement to
fix the problem, immediately above the preceding statement:

this.SetStyle(ControlStyles.UserPaint, true);

I'm still having the same problem.

Any ideas why the transparent area is drawing black? How do I fix this?
Thanks in advance.

David Veeneman
Foresight Systems
 
D

David Veeneman

I found the cause of my problem. In some of the controls, I had included the
following statement:

grfx.Clear(this.BackColor);

When I removed this line from the controls, transparency worked fine.

David Veeneman
Foresight Systems
 

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