lu
2025-06-09 ccc1b0d541d8f3bdd2bcb72dd0b5533e68b886d5
DevApp/Gs.DevApp/DevFrm/FrmMain.cs
@@ -25,7 +25,7 @@
        /// tab临时选项卡
        /// </summary>
        private static readonly Dictionary<string, XtraTabPage> TabPageDic = new Dictionary<string, XtraTabPage>();
        private string OldorgFids = "";
        public FrmMain()
        {
            InitializeComponent();
@@ -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>