transparent picturebox

R

Richard Saville

I am trying to make a transparent pictureBox. MSDN says to use
this.SetStyle(ControlStyles.SupportsTransparentBackColor, true); for the
form
and this.pictureBox1.BackColor = Color.Transparent; for the pictureBox

I does not seem to work. I have put this pictureBox on top of another one,
but its background is gray and it blocks the image. What am I doing wrong?

Thanks
 
E

Eric Eggermann

Richard Saville said:
I am trying to make a transparent pictureBox. MSDN says to use
this.SetStyle(ControlStyles.SupportsTransparentBackColor, true); for the
form
and this.pictureBox1.BackColor = Color.Transparent; for the pictureBox

I does not seem to work. I have put this pictureBox on top of another one,
but its background is gray and it blocks the image. What am I doing wrong?

Thanks


Unfortunately, this is not an answer to your question, but I've faced this
before, and it seems to me that setting the control style to Transparent
causes the background of the control to be painted with what is under it on
the form or maybe container, rather than with whatever is underneath it in
the zorder. I haven't checked it out enough to notice if it behaves the same
for any container.

I did not find the answer. I'm very interested if you do.

Eric
 

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