Click here to Skip to main content
15,886,578 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i was trie to set in mdichild activate event but its work form all child form but i wat its for only one child form form2. i have 3 child form. form1,Form2 and form3.
please help me how can i solve it..

What I have tried:

private void MDI PATENT_MdiChildActivate(object sender, EventArgs e)
{

if(this.mdichildren.lenght==null)
{
messagebox.show("Form 2 is Closed");
}
}
Posted
Updated 14-Feb-16 21:03pm
v2
Comments
Sinisa Hajnal 15-Feb-16 3:33am    
If you want something when the child is closed, you should handle closing or closed event of the child form. If you need to do something in parent form, I think you have to publish your own event that you will trigger in form closed of the child form.
(this assumes I understand your question correctly, please write in your native language and use google translator as a starting point if you're not sure how to formulate the question in English)
Arth01 15-Feb-16 4:14am    
opps sorry for confusion..

1 solution

Instead of relying on the Activate method for a different child - which may not happen if there is only one MDI child open - handle the FormClosing or FormClosed event instead and display your message box in that.
 
Share this answer
 
Comments
Arth01 15-Feb-16 4:14am    
ya thanks got it..
OriginalGriff 15-Feb-16 4:21am    
You're welcome!
BillWoodruff 15-Feb-16 16:19pm    
"But in these cases
We still have judgment here, that we but teach
Bloody instructions, which, being taught, return
To plague th' inventor"

http://www.codeproject.com/Answers/1078694/How-to-visible-panel-in-mdi-parent-form-when-child

:)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900