Hi,
Can anyone tell me ,when we click on close button in WPF it should ask for password .
Regards,
Shwetha
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jaganathan BantheswaranPosted Jan 21, 2014, 4:13 AM
Shwetha DaliPosted Jan 21, 2014, 1:48 AM
Jaganathan BantheswaranPosted Jan 21, 2014, 1:19 AM
You have to write your code on Closing event of Window.
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
//Here prompt for password.
if(passwordiscorrect)
{
e.Cancel = false;
}
{
e.Cancel = true;
}
}