Hi Frank,
Thanks for choosing Syncfusion products.
I have used the two static variables ( activeChild,flag) in the MainForm.cs for handling activeMdiChild. Please change the code in MdiChildActivated and Document_Closing methods as shown below in order to get this work.
Here is the modified code snippet:
In MainForm.cs ,
Public static Document1 activeChild;
public static Boolean flag = true;
protected void MDIChildActivated(object sender, System.EventArgs e)
{
if (flag == false)
{
this.ActivateMdiChild(activeChild);
flag = true;
}
if (this.ActiveMdiChild == null)
{
statusBar1.Text = "";
}
else
{
statusBar1.Text = this.ActiveMdiChild.Text;
}
}
In Document1.cs
private void Document1_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
DialogResult rst = MessageBox.Show("Do you want to close this window?", "TabbedMDI",
MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation);
if (rst == DialogResult.No)
{
e.Cancel = true;
MainForm.activeChild = this;
MainForm.flag = false;
return;
}
else if (rst == DialogResult.Cancel)
{
e.Cancel = true;
MainForm.activeChild = this;
MainForm.flag = false;
return;
}
else
MainForm.flag = true;
}
Please refer the attachments.
TabbedMDI.zipPlease let me know if this works.
Regards,
S.Gopal.