When I place Button in grid and add to is’s click action:
this.Close();
It’s not working. I want to be able to ask user before exit so I want to use Close(). I don’t want to use Application.Shutdown();
How to solve it.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Just tested it and it works fine! I created a new WPF application and a basic window:
and then added the following to the code-behind
And it works 100%… Can you post more code to see if something else is wrong? What .NET version are you using, etc…