1

I need to put a picturebox above another picture box, the picturebox on top is a png file with a transparent background but when trying to use Picturebox.BringToFront(); the picturebox below is replaced with what is in the background of the form.

I tried to get around this using picturebox.Parent = picturebox2, but I don't want the picturebox to be cut off at the edges of the other picturebox it's on top of.

  • 2
    That's where PictureBox stops being useful. Instead, use Graphics.DrawImage() in an event handler of the form's Paint event. – Hans Passant Dec 13 '22 at 00:28
  • 1
    Here's an example of what Hans is saying https://stackoverflow.com/a/38585086/495455 – Jeremy Thompson Dec 13 '22 at 00:32
  • 1
    That's how transparency works in WinForms. It's not real transparency; it's fake. A transparent control simply takes what it is covering of its parent and displays that in its own background. That's what you're seeing. It is not possible to have a sibling control show through. – jmcilhinney Dec 13 '22 at 02:20

0 Answers0