Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3359188
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T02:50:32+00:00 2026-05-18T02:50:32+00:00

This is probably a simple question but i’ve been unable to find a quick

  • 0

This is probably a simple question but i’ve been unable to find a quick answer.

I have a WPF application which has a Windows Forms Control hosting a GeckoFX component (doesn’t really matter).

What i want to do is capture key down events inside the Windows Forms Control and grab focus of a WPF control for some particular key combination.
And what if i want to capture events from the entire WPF application window (even inside the Windows Forms Control)?
I tried handling the KeyDown event and PreviewKeyDown event but to no avail.

What i want to know is if this is possible and how this should be done. I can post some code if required.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T02:50:32+00:00Added an answer on May 18, 2026 at 2:50 am

    The KeyDown even on the Form should work for non special keys (like arrow keys). Use PreviewKeyDown to capture those, or use this solution.

    For GeckoWebBrowser specifically, I had to use PreviewKeyDown. Also, I added a line so it doesn’t break in design mode:

    private void webBrowser1_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e) {
      if (DesignMode) return;
      if (!e.IsInputKey && e.Control && e.KeyCode == Keys.S) {
        DoStuff();
        return;
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know this is probably a really simple question but I'm having a brain
Probably a simple question but I haven't found a solution. I have several view
This is probably a simple question, but I can't figure it out. I would
Hey, this is probably a simple question, but I am having trouble running my
This is probably a very simple question for some, but it has me stumped.
This is probably a very simple question for some, but it has me stumped.
I know this is probably a very simple question, but I can't seem to
This is probably a very simple question to an experienced person with UNIX however
This is probably a very simple question to an experienced person with UNIX however
I created a scaffold dum num:integer name:string When I create a new dum, I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.