lu
2025-05-30 e3b7fd23fa49bc0329e43d274d9a3e0563e4420d
DevApp/Gs.DevApp/DevFrm/FrmMain.cs
@@ -298,13 +298,25 @@
                return;
            }
            foreach (XtraTabPage item in tabControl.TabPages)
            {
                if (item.Name == name)
                {
                    //后来加上,为了释放窗体资源beg
                    //foreach (Control control in item.Controls)
                    //{
                    //    if (control is Form)
                    //    {
                    //        Form myForm = control as Form;
                    //        myForm.Invoke((MethodInvoker)delegate { myForm.Dispose(); }); // 确保 UI 线程安全地释放资源
                    //    }
                    //}
                    //后来加上,为了释放窗体资源end
                    tabControl.TabPages.Remove(item);
                    item.Dispose();
                    TabPageDic.Remove(name);
                    return;
                }
            }
        }
        /// <summary>