Ah, now I get you.
What you need is a way to know when the child is closing. You can use the Child's OnClosing event. Call the parent and if needed have the parent call BringToFront() on the panel
For instance, in your child's closing event call
((Form1)MdiParent).ReActivatePanel();
and in your MdiParent ...
public void ReActivate()
{
// if MdiChildren.Length == 1, it will be 0 shortly since the
// child calling the method is about to close
if(this.MdiChildren == null || this.MdiChildren.Length < 2)
panel1.BringToFront();
}
On Sun, 22 May 2005 13:52:02 +0200, perspolis <re*****@hotmail.com> wrote:
I put a panel in MDI parent..when I want to show a child I have to call this
fragment code to show the child
this.Panel.SendToBack();
ChildForm ch=new ChildFrom();
ch.MdiParent=this;
ch.Show();
if I don't call this.Panel.SendToBack() ,the child is showed under Panel;
when I close the child ,the panel isn't showed anymore.
"Morten Wennevik" <Mo************@hotmail.com> wrote in message
news:op.sq6ddlcgklbvpo@stone... Not sure if I understand your scenario. You have a panel on an MdiParent,
but not in the client area (docked?)
In any case, you probably have something in your code doing something
unintended. If you can show us a small but complete code sample
demonstrating your problem maybe we can help you.
On Sun, 22 May 2005 11:03:40 +0200, perspolis <re*****@hotmail.com> wrote:
> No,I put the panel inside parent form..but when I show childrend forms and > then close them,I can't see the panel??
> "Morten Wennevik" <Mo************@hotmail.com> wrote in message
> news:op.sq5276emklbvpo@stone...
>> Hi Persepolis,
>>
>> What do you mean disappear? Did you put the panel inside the MdiParent
> client field?
>>
>>
>> On Sun, 22 May 2005 09:16:49 +0200, perspolis <re*****@hotmail.com> wrote: >>
>> > Hello All
>> > In a MDI application,I have a panel.but when I show children forms the > panel
>> > disappear.???
>> >
>> >
>> >
>>
>>
>>
>> --
>> Happy coding!
>> Morten Wennevik [C# MVP]
>
>
>
--
Happy coding!
Morten Wennevik [C# MVP]
--
Happy coding!
Morten Wennevik [C# MVP]