I have a simple windows app consisting of only two forms. This is an intranet app that runs on some specific desktops constantly and users have no control over closing them (among other things).
I want to abe able to associate a key sequecne (let's say Ctl + Esc) to exist the app and also provide an admin password to do so. This is so that admins can close the app and restart it again if necessary.
Thanks.
Loading
MoPosted Jun 13, 2010, 10:53 PM
I also found this on the net that allows any key combination to be associated with some action:
http://www.csharpdeveloping.net/Article.mvc/shortcut_manager_-_keyboard_shortcuts_in_winforms_by_win_api
Kirtan PatelPosted Jun 13, 2010, 4:22 AM
private void Form1_Load(object sender, EventArgs e)
{
this.KeyPreview = true;
}
private void Form1_KeyDown(object sender, KeyEventArgs e)
{
if (e.Shift == true && e.KeyData == Keys.E)
{
Application.Exit();
}
}