Make A Control Be On Top

Or Betzalel picture Or Betzalel · Jan 13, 2011 · Viewed 15k times · Source

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

(window form application, c#)

Answer

noelicus picture noelicus · Jun 27, 2013

In the code you have a few of calls you can make. BringToFront and SendToBack are probably the simplest:

yourControl.BringToFront();
yourControl.SendToBack();

Also you could control that from the control's parent container using Control.ControlCollection.SetChildIndex. For example:

// Bring control to front    
MyForm.Controls.SetChildIndex(SomeControl, 0); 

Otherwise just click "Bring to Front" or "Send to back" in the designer, as @KeithS has already answered.