//My project is in C#.NET 2.0

I have multiple forms in my mdi container window .

When I tried to close mdi form , form closing event of a child form (which has current focus/active child ) occurs before the form closing event of mdi form.

Can anybody help me out there?

Recommended Answers

All 2 Replies

That's why it is called MDIParent.

Actually it's my mistake......
I was looking for the reason of child form closing so that I can write the code in that manner.
By Checking property 'CloseReason' of FormClosingEventArgs we can decide what steps to follow.

if ( e.CloseReason==CloseReason.UserClosing )
{
}

Well thanks for the quick reply.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.