title: Handling key events on WebBrowser control?
body: <p>Currently I am using an application which play <code>ppt</code> and flash in WebBrowser Control.</p>
  
  <p>In WebBrowser I am able to hide context menu by using </p>
  
  <pre><code>this.IsWebBrowserContextMenuEnabled = false;
  </code></pre>
  
  <p>and capture key event by using </p>
  
  <pre><code>this.PreviewKeyDown += new PreviewKeyDownEventHandler(IWebBrowser_PreviewKeyDown);
  </code></pre>
  
  <p>but while playing the <code>ppt</code>, both context menu and keypress events are not functioning i.e. I can see context menu and arrow key force the <code>ppt</code> to change the slide. </p>
  
  <p>Again while playing flash, context menu is visible and I can handle key event. is there any other setting to it can same for whatever (<code>HTML</code>, <code>PPT</code>, <code>Flash</code>, <code>PDF</code>) is playing in webBrowser?</p>
  
  <p><strong>Edit :1</strong>
  Here is my existing code</p>
  
  <pre><code>class IWebBrowser : WebBrowser
  public IWebBrowser(RegionOptions options)
  {
      try
      {
          this.Width = 600;
          this.Height = 400;
          this.IsWebBrowserContextMenuEnabled = false;
          this.ScrollBarsEnabled = false;
          this.ScriptErrorsSuppressed = true;
          this.WebBrowserShortcutsEnabled = false;
          this.AllowNavigation = true;
          CreateContextMenu();
          this.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(IWebBrowser_DocumentCompleted);
          this.PreviewKeyDown += new PreviewKeyDownEventHandler(IWebBrowser_PreviewKeyDown);
      }
      catch (Exception ex)
      {
          log.Error("IWebBrowser - ctor ", ex);
      }
  }
  private void CreateContextMenu()
  {
  
      ContextMenuStrip myContextMenu = new ContextMenuStrip();
      this.ContextMenuStrip = myContextMenu;
  
      ToolStripMenuItem myFirstTooltip = new ToolStripMenuItem();
      ToolStripMenuItem mySecondTooltip = new ToolStripMenuItem();
      ToolStripMenuItem myThirdTooltip = new ToolStripMenuItem();
  
      myFirstTooltip.Text = "Item One";
      mySecondTooltip.Text = "Item Two";
      myThirdTooltip.Text = "Item Three";
  
      myContextMenu.Items.Add(myFirstTooltip);
      myContextMenu.Items.Add(mySecondTooltip);
      myContextMenu.Items.Add(myThirdTooltip);
  }
  </code></pre>
  
  <p>context menu Images for different controls played in webbrowser
  <br>Display a webpage..................<br>
  <img src="https://i.stack.imgur.com/Mw69g.png" alt="Contextmenu webpage">
  <br>flash played in  webbrowser.................<br>
  <img src="https://i.stack.imgur.com/QJArd.png" alt="Context menu in flash(displayed in webbrowser) ">
  <br>ppt played in webbrowser.....................<br>
  <img src="https://i.stack.imgur.com/ledDg.png" alt="Context menu in PPT(displayed in webbrowser)"></p>