I know in a WinForm application I can use the "FormClosing" Event Handler. Is it possible to do something like that in a Console application? Im using the .Net Framework
Asked
Active
Viewed 695 times
0
-
3Not as far as I know. Why do you need to? – ADyson Jul 08 '20 at 19:17
-
1Possible duplicate: https://stackoverflow.com/q/1119841/12888024 – aepot Jul 08 '20 at 19:19
-
1You can, but it's not straightforward. https://stackoverflow.com/questions/474679/capture-console-exit-c-sharp – Sach Jul 08 '20 at 19:19
-
Would it NEED to be because of the "X" button? – Broots Waymb Jul 08 '20 at 19:20
-
I need to do this because I am trying to add events when they close the application such as a dialog saying "Are you sure you would like to close the application", something like that. – Jordan Houston Jul 08 '20 at 19:21
-
2@JordanHouston if you're showing a dialog for a console application, perhaps you should be using another type of application. – Broots Waymb Jul 08 '20 at 19:22
-
The requirements say a "Command Line Application" – Jordan Houston Jul 15 '20 at 17:34