Global KeyDown Event

Posted on 2011-10-14
Last Modified: 2012-05-12
Is there any way to assign a global shortcut (I.E Ctrl + B) to an application without having to go through each form and apply a KeyDown event?

Question by:dvargas531
    LVL 74

    Expert Comment

    by:käµfm³d 👽
    IIRC, you turn on the KeyPreview property for the Form; then add a handler for the keydown event of the form.
    LVL 14

    Expert Comment

    by:nishant joshi
    you gave to add events on each form...
    LVL 85

    Accepted Solution

    Yes...trap it via IMessageFilter.

    Author Comment

    I want the shortcut to open a form to submit any bugs, so I need to to be available for every form on the application. I don't mind adding events to each form, but I'm running into an issue with this process. I added the KeyDown event to the form, but if the user has a grid or some other control selected the KeyDown event for the form won't fire unless the event is also added for each control.

    Author Comment

    Idle Mind, thanks I'll give it a shot

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Join & Write a Comment

    Bit flags and bit flag manipulation is perhaps one of the most underrated strategies in programming, likely because most programmers developing in high-level languages rely too much on the high-level features, and forget about the low-level ones. Th…
    This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now