OnKeyPress

J

Jon Rea

Hi,

First of all is there/ what is the Archive URL of this newsgroup ?



Secondly I want to handle keypresses in my application. When i add events to
Keydown or Keypress to the main form, the events are not triggered upon
pressing any key ...

Any ideas what i am doing wrong ? - see very simple code below ....

Many thanks in advance

Jon Rea



// VC++ c# .net generated code

this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.onKeyDown);

this.KeyPress += new
System.Windows.Forms.KeyPressEventHandler(this.onKeyPress);



//function added by the event section of the properties window

private void onKeyPress(object sender,
System.Windows.Forms.KeyPressEventArgs e)

{

MessageBox.Show("hello");

}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top