Picturebox Layering

Hello. I have three picture boxes:
1.) Background Image (JPG)
2.) Circle (Transparent GIF)
3.) Triangle (Transparent GIF)

The arrow keys move the circle left and right, up and down. Currently, i have the circle and the triangle's parent set to picturebox1 (background image). When the circle moves over top of the triangle, the areas around the circle where you should see the triangle underneath are simply gone, with pieces of the background image visible where the triangle should be.

The first picturebox is furthest back into z space, the third box is in the middle (triangle), and the 2nd box is on top(circle). How can i fix this issue?
[678 byte] By [TCanuck42] at [2007-11-20 11:34:29]
# 1 Re: Picturebox Layering
Call the Refresh method of a control to force it to redraw itself.
jmcilhinney at 2007-11-10 3:08:16 >
# 2 Re: Picturebox Layering
This did not work. The circle's parent is the background picturebox, and the triangle's parent is the background picturebox, so when one is over top of the other, each image shows its parent's image in the transparent areas. How can i change this to my desired specifications as i mentioned in my first post., so that you can see the triangle underneath the circle. Thanks!
TCanuck42 at 2007-11-10 3:09:14 >
# 3 Re: Picturebox Layering
Sorry, I didn't really get it first time. That's how control transparency works in .NET. If you want it otherwise then you can't use controls like that. Just use one PictureBox with the background image and then use GDI+ to draw the other two in the control's Paint event handler.
jmcilhinney at 2007-11-10 3:10:12 >
# 4 Re: Picturebox Layering
Please go into detail. I am new at this kinda stuff. What syntax would i use to draw an image located in a recourse file to a specific location?
TCanuck42 at 2007-11-10 3:11:23 >
# 5 Re: Picturebox Layering
In the Paint event handler you would call the e.Graphics.DrawImage method and supply the appropriate parameter values. Those parameter values would be stored in member variables. To change how the drawing is performed you would change the values of those variables and force a repaint by calling either Refresh or Invalidate and Update. I suggest that you read the documentation for the Control.Paint event and the Graphics.DrawImage method first of all. Some reading on GDI+ in general would not hurt either.
jmcilhinney at 2007-11-10 3:12:22 >