Search code examples
c#imagewindows-forms-designertopmost

Make A Control Be On Top


I have this one Image and I want it to be on top of another image.

(window form application, c#)


Solution

  • If it's one control partially overlapping another, and you want one or the other on top, right-click the image you want on top in the designer, and choose "Bring To Front". There is a "Send To Back" that you can use on the image you want behind the other.

    If you want partial transparency, like an alpha mask on the top image or a gradient blend between two images right on top of the other, you'll probably need the more advanced capabilities of WPF graphics. You CAN do pixel-by-pixel effects in WinForms, but there isn't anything built in to Winforms to handle image transparency, and per-pixel manipulation of an Image in Winforms won't take advantage of any graphics acceleration (100% CPU, with the runtime's overhead slowing you down further).