tags:

views:

40

answers:

1

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?

A: 

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();
}
KevinDeus
There must be some code somewhere that's stopping the form from closing naturally.
Fara
Try e.Cancel = false; instead.
Hans Passant