开发者

this.Close() won't work

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜