When I add krypton items to my form, they appear over the top of the others, how can I make it so that I can put something behind the other items?
Asked
Active
Viewed 1.3k times
2 Answers
17
Assuming you're using the Winform designer, you can right click a control and select 'Bring to Front' or 'Send to Back' from the context menu to change the control's 'z-order.'

Jay Riggs
- 53,046
- 9
- 139
- 151
-
Sorry, it wouldn't let me select it when he answered. – Levi H May 19 '11 at 17:54
4
The order of control appearing inside their parrent container is controlled by Z-Index.
Right click control in the designer. Select "Bring ro front" from the context menu.
If you doing it programmtiacly. All control in winforms environment have two methods : BringToFront() and SendToBack(). You can call it to setup z-index of controls.
If you want to specify Z-Index explicitly you may use this workaround:
public static class ControlExtension
{
public static void SetControlZIndex(this Control ctrl, int z)
{
ctrl.Parent.Controls.SetChildIndex(ctrl, z);
}
}
Usage:
button1.SetControlZIndex(10);

v00d00
- 3,215
- 3
- 32
- 43