Skip to content

How to Stop Closing Application when Ctrl+Q is Executed? #1413

Answered by BDisp
ichan-akira asked this question in Q&A
Discussion options

You must be logged in to vote

Try this:

Application.Top.KeyPress += (e) => {
	if (e.KeyEvent.Key == (Key.CtrlMask | Key.Q)) {
		// Do nothing and return true
		e.Handled = true;
	}
};

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
3 replies
@ichan-akira
Comment options

@ichan-akira
Comment options

@BDisp
Comment options

Answer selected by ichan-akira
Comment options

You must be logged in to vote
1 reply
@ichan-akira
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants