title: C#: Windows Forms: Getting keystrokes in a panel/picturebox?
body: <p>I'm making a level editor for a game using windows forms. The form has several drop down menus, text boxes, etc, where the user can type information.</p>
  
  <p>I want to make commands like <code>CTRL + V</code> or <code>CTRL + A</code> available for working within the game world itself, not text manipulation. The game world is represented by a <code>PictureBox</code> contained in a <code>Panel</code>.</p>
  
  <p>This event handler isn't ever firing:</p>
  
  <pre><code>private System.Windows.Forms.Panel canvas;
  // ...
  this.canvas = new System.Windows.Forms.Panel();
  // ...
  this.canvas.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler(this.canvas_PreviewKeyDown);
  </code></pre>
  
  <p>What is the preferred way of doing this? Can a <code>panel</code> even receive keyboard input? I would like to allow the user to use copy/paste/select-all commands when working with the text input, but not when placing objects in the game world.</p>