I have an exit button on winform that I want to use to close the program. I added the button name to the FormClosed property found in the events section of the winforms properties. I thought that all I needed to do, but when I press the button, it does not close. I looked at the code, and when the handler is created, there is no code inside it. I donโt know if it is right or wrong. Here is the code that was created in the Form.cs file:
private void btnExitProgram_Click(object sender, EventArgs e) { }
What else do I need to do?
c # winforms
Programming newbie
source share