Make a transparent picturebox

A

active

I have a UserControl that contains two pictureboxes.
One on top of the other.
The top one is smaller then the bottom one.
The top one is to be transparent.
I want to draw on it and then sometimes clear it and sometimes copy the
drawing to the bottom picturebox image or BackgroundImage.

Just to see if it would work I set the Background color of the top one to
transparent but, rather then seeing the bottom box in the transparent one I
see the UserControl backcolor. Is this to be expected?

As I read in the Help I can create a Bitmap that is transparent. I guess I
could set the Image of the top box to nothing and the background image to
the bitmap.

Not sure if that will work but it seems a shame to create another (big)
bitmap.

Is that the way to go or is there a cleaner way?


Cal
 
A

active

I found the answer on the internet. I wished I recorded the site so I could
give it credit here but it was a FAQ site that listed three ways to use
transparent pictureboxes.

The third way was to make the box that is to show through, the parent of the
transparent one.

Works great

Cal
 

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