会员
周边
众包
新闻
博问
闪存
赞助商
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
希望可以不学习
从小的最大理想,但永远也实现不了。
博客园
首页
新随笔
联系
管理
订阅
C#子窗口关闭父窗口
父窗口的定义
namespace
Test
{
public
delegate
void
ChildClose();
public
partial
class
Parent : Form
{
private
void
btnLogIn_Click(
object
sender, EventArgs e)
{
Chield ch
=
new
Chield();
ch.closeFather
+=
new
ChildClose(
this
.Close);
ch.Show();
this
.Visible
=
false
;
}
}
}
子窗口的定义:
namespace
Test
{
public
partial
class
Chield : Form
{
public
event
ChildClose closeFather;
public
Chield ()
{
InitializeComponent();
}
private
void
Chield_FormClosed(
object
sender, FormClosedEventArgs e)
{
closeFather();
}
}
}
posted on
2007-09-13 17:14
pdfw
阅读(
5154
) 评论(
0
)
编辑
收藏
举报
会员力量,点亮园子希望
刷新页面
返回顶部
公告