By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,660 Members | 1,562 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,660 IT Pros & Developers. It's quick & easy.

C#(Quit the application) - shift+Ctrl+Q

P: n/a
Dev
Dear Friends,

I have created Application using VC#.

How do to the following tasks?

The user should not be allowed to exit the program: the start menu, end
task and all other ways of exiting the program should be
disabled. The Shift+Ctrl+Q (or other keystroke combination) should be the
only way to exit the program.

I disabled the close button.
If anyone knows ....Please help me....
Any suggestions would be greatly appreciated....

Thanks,
Rajan

Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
I don't know how you would disable "end task" from closing your program, but
I have no idea why you'd want to do that....When all else fails, you need a
way to close the program *somehow.*

Anyways, just add a handler for the Windows_Closing event in your main form
that sets the "Cancel" property to true

private void MainForm_Closing(object sender, CancelEventArgs e)
{
e.Cancel = myKeyStrokeWasPressed;
}

where myKeyStrokeWasPressed is a bool you'd set to false if, say,
Shift-Ctrl-Q was pressed. Otherwise, it's true.

"Dev" <ra********@hotmail.com> wrote in message
news:e5**************@TK2MSFTNGP11.phx.gbl...
Dear Friends,

I have created Application using VC#.

How do to the following tasks?

The user should not be allowed to exit the program: the start menu, end
task and all other ways of exiting the program should be
disabled. The Shift+Ctrl+Q (or other keystroke combination) should be the
only way to exit the program.

I disabled the close button.
If anyone knows ....Please help me....
Any suggestions would be greatly appreciated....

Thanks,
Rajan


Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.