dv2020
会员
- 已加入
- 2020年12月18日
- 留言内容
- 19
- 编程经验
- 1-3
大家好,
最近发现了这个论坛,看起来很棒。这是我的第一篇文章。
我有一个正在使用的应用程序,当用户从数据网格中选择日期时,该应用程序会在选福彩12选5走势图控件中加载新的选福彩12选5走势图。
当用户关闭该特定标签(例如1/1/2020)时,我无法执行此代码。
我有这段代码,删除了运行良好的选定选福彩12选5走势图1/1/2020,但是对于在选择选福彩12选5走势图中加载的特定winform实例,它将不会运行disposeALLreports();。
tabpages.remove也不会触发表单关闭触发器。
我对此有些困惑,有什么想法吗?
提前致谢
大卫
最近发现了这个论坛,看起来很棒。这是我的第一篇文章。
我有一个正在使用的应用程序,当用户从数据网格中选择日期时,该应用程序会在选福彩12选5走势图控件中加载新的选福彩12选5走势图。
- 当他们选择日期时,例如1/1/2020,一个新的选福彩12选5走势图将在tab控件内打开,该选福彩12选5走势图的文本设置为1/1/2020。
- 用户可以打开多个日期,这将打开多个具有不同日期的选福彩12选5走势图
- 在每个选福彩12选5走势图内,它将加载现有winform的新实例。
- 在该获胜表格中,我们有一些代码。
C#:
public void disposeAllReports()
{
if (this.crystalReportViewer1 != null) { this.crystalReportViewer1.Dispose(); }
if (this.cryRpt != null) { this.cryRpt.Close(); }
if (this.cryRptSum != null) { this.cryRptSum.Dispose(); }
if (this.crystalReportViewerProfileSum != null) { this.crystalReportViewerProfileSum.Dispose(); }
if (this.cryRptSum != null) { this.cryRptSum.Close(); }
if (this.cryRptSum != null) { this.cryRptSum.Dispose(); }
if (this._dbConnectRead.checkConnection() == true) { this._dbConnectRead.CloseConnection(); }
if (this._dbConnectSave.checkConnection() == true) { this._dbConnectSave.CloseConnection(); }
GC.Collect(); // I forgot this line
}
当用户关闭该特定标签(例如1/1/2020)时,我无法执行此代码。
我有这段代码,删除了运行良好的选定选福彩12选5走势图1/1/2020,但是对于在选择选福彩12选5走势图中加载的特定winform实例,它将不会运行disposeALLreports();。
this.tabReportModules.TabPages.Remove(selectedTabPage);
tabpages.remove也不会触发表单关闭触发器。
我对此有些困惑,有什么想法吗?
提前致谢
大卫
由主持人最后编辑: