| | |
| | | { |
| | | 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 线程安全地释放资源 |
| | | // } |
| | | //} |
| | | //2025-08-08加上,为了释放窗体资源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(); |