开发者

this.Close() won't work

开发者 https://www.devze.com 2023-01-23 02:30 出处:网络
I have a windows forms app (c# 4.0) and the \"X\" button won\'t close the form, and this.close() won\'t do it either.

I have a windows forms app (c# 4.0) and the "X" button won't close the form, and this.close() won't do it either.

Other forms work fine, yet when I copy the designer over to 开发者_如何学编程a new form, it breaks that form too!

any clues?


so... apparently this makes it work (creating a closing event, and putting in the following code)

private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
    this.Dispose();
}
0

精彩评论

暂无评论...
验证码 换一张
取 消