I modified the sample you gave Javier a little bit to reproduce the problem.
Steps to reproduce the problem:
- Run the app
- Click on ''New child'' 3 times (to create 3 tabs).
- Click on ''Child 2'' tab, then ''Child 1'' tab (the order matters).
- Now click on the close button of the MDI tab manager 3 times (to close all 3 tabs).
- Finally try to close the MDI main form.
The problem appears when you start your MDI with zero child form. After you create the forms, try to click each tab once starting with the second highest one. For example, if you create 4 tabs (tab 0, tab1, tab2, tab3) you must click tab3, then tab2, then tab1 and finally tab0. After that, just click the X button 4 times to close them all. Now the MDI main form cannot be closed.
>Hi Khoi Phan,
>
>Thanks for the modified sample. I have tested this as per your directions in v2.1.0.9 and the sample worked fine. After closing the tabbed MDI child forms, I was able to close the main form by clicking on it "X" close button, without having to use the workaround of handling the Closing event and calling a Dispose on itself. Are you using on earlier version of Essential Suite ? If so, could you please upgrade to v2.1.0.9 and see if you can recreate this problem in our latest release?
>
>
>Hi Javier,
>
>I have attached a
test sample here created as per your requirements in your first update. Please note the TabbedMDIManager''s TabControl, host form''s Load and the BarItem''s Click event handlers.
>
>TabControlAdv tabcontrol;
> TabPageAdv tabpage;
>
> private void TabbedMDI_TabControlAdded(object sender, TabbedMDITabControlEventArgs args)
> {
> tabcontrol = args.TabControl;
> }
>
>private void Form1_Load(object sender, System.EventArgs e)
> {
> this.tabpage = this.tabcontrol.TabPages[0];
> this.tabcontrol.SelectedTab = this.tabpage;
> this.tabcontrol.TabPages.MoveTabPage(this.tabcontrol.TabPages.IndexOf(tabpage), 0);
> }
>
> private void barItem1_Click(object sender, System.EventArgs e)
> {
> f1 = new Form2();
> f1.Name = "Child1";
> f1.Text = "Child1";
> f1.SetLabel("Child1");
> f1.MdiParent = this;
> f1.Show();
>
> this.tabcontrol.TabPages.MoveTabPage(this.tabcontrol.TabPages.Count-1, 0);
> }
>
>Please let me know if this meets your requirements. Thanks for choosing Syncfusion products.
>
>Regards,
>Guru Patwal
>Syncfusion, Inc.
tabbedmdi_taborder_2019.zip