Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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#)

like image 901
Or Betzalel Avatar asked Dec 02 '22 03:12

Or Betzalel


1 Answers

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.

like image 97
noelicus Avatar answered Dec 04 '22 17:12

noelicus