How to cancel any keyboard stroke?

csharp Yemen
  • 13 years ago

    I want my application to cancel any key stroke from keyboard, any function keys such as Ctrl, Alt, especially Start key and of course any combination of keys
    such as Ctrl+C, Alt+F4, Ctrl+Alt+Delete and etc.

    Is there any way to do so?

    And if there no way to cancel any key stroke generally, is there any way to assign a new functionality to a combination of keys.

    As example:
    I want Ctrl+Alt+Delete to call some method or make some operations in my application, instead of opening Task Manager.

    My application is an application that take control on loging and using computer, so i want to cancel keys strokes to prevent any user from closing the application or minimize it to the taskbar.

    You can consider my application in a way similar to internet cafe applications.

    Please, excuse my bad english, i'm new at lerning english


  • 13 years ago
    Is it windows Application(Desktop Application) or web application
    if window App then, in property of the form u have a property called keypreview, set that value to true
    then All the keystroke event will come to ur function first, if u want to cancel that key u can do that.

    for web u can write a javascript function on the frm key down event.


  • 13 years ago

    Thanks, it works.

    I do canceled the comb Alt+F4 and Alt+Tab but i couldn't catch the comb Ctrl+Alt+Delete ..

    is there any easy way to catch this combination and canceling it.

Post a reply

Enter your message below

Sign in or Join us (it's free).


Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“My definition of an expert in any field is a person who knows enough about what's really going on to be scared.” - P. J. Plauger