Transparent background problem

  • Thread starter Thread starter David Veeneman
  • Start date Start date
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
 
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
 
Back
Top