C# .NET - Mdi child hidden behind user control.

Asked By asif hameed on 15-Oct-10 05:13 AM
Hi All:

I have a windows MDI form. It has a user control will links. When user clicks a link a mdi child is opened. but it is hidden behind user control. Can I make it in front of user control ?

Regards,
Asif Hameed
Anurag replied to asif hameed on 15-Oct-10 08:31 AM
On the click event when u use form1.show();
U can use form1.focus(); to set the focus on ur child form.
U will get complete idea from this link:
http://www.devasp.net/net/articles/display/695.html
Also the control layout of an MDI child form may be corrupted at run time for an MDI-based application in the .NET Framework 1.1 SP1, for "fix" go to:
http://support.microsoft.com/kb/884901
asif hameed replied to Anurag on 15-Oct-10 08:34 AM
is there anything like z index in windows applications ?
Anurag replied to asif hameed on 16-Oct-10 02:10 AM
In CSS  z-index property specifies the stack order of an element.

An element with greater stack order is always in front of an element with a lower stack order.

Note: z-index only works on positioned elements (position:absolute, position:relative, or position:fixed).
Refer these links for more details: http://www.w3schools.com/css/pr_pos_z-index.asp
http://tjkdesign.com/articles/z-index/teach_yourself_how_elements_stack.asp
So in ur case u can set a higher zindex value for the control which u want to be on top of the other control which will be having lower z index value.