By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,691 Members | 1,143 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,691 IT Pros & Developers. It's quick & easy.

Make a transparent picturebox

P: n/a
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

Nov 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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
" active" <ac****@REMOVEa-znet.com> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
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

Nov 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.