赞
踩
- try
- {
- if (ab.IsDisposed)
- {
- ab = new about();
- }
- ab.ShowDialog();
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.Message);
- }
this.Dispose();
1.父窗体调用子窗体代码
- try
- {
- if (ab.IsDisposed)
- {
- ab = new about();
- }
- ab.ShowDialog();
- ab.Dispose();//关键在这里,应该由父窗体来Dispose
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.Message);
- }
2.子窗体退出代码:
-
-
- this.Close();//子窗体只把自己Close,不Dispose
-
-
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。