I am creating a level editor for a game using window forms. The form has several drop-down menus, text fields, etc., where the user can enter information.
I want to make commands like CTRL + Vor CTRL + Aavailable for work in the game world itself, and not for word processing. The world of the game is presented PictureBoxcontained in Panel.
This event handler never starts:
private System.Windows.Forms.Panel canvas;
this.canvas = new System.Windows.Forms.Panel();
this.canvas.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler(this.canvas_PreviewKeyDown);
What is the preferred way to do this? Can I Panelget keyboard input? I would like to allow the user to use the copy / paste / select-all commands when working with text input, but not when placing objects in the game world.