If enyone will have the same problem, I found the answer. You will need to use the MdiChildActivate
event of the parent form. This event will appear when the child is created and when the cild is closed, to resolve this probleme, use this code:
Create a private varible outside the function set on 0:
private: static int closeChild = 0;
In private: System::Void Form1_MdiChildActivate(System::Object^ sender, System::EventArgs^ e)
use this code:
closeChild++;
String ^ childName = this->MdiChildren[0]->Text;
if(closeChild == 2)
menu_open->Enabled=true;
closeChild
will be 2 on closing. And don't forget to reset closeChild
to 0 when a new child is created becouse closeChild
will increment to 3, etc..
Good luck !