Raising an Event

  • Thread starter Thread starter Jamie
  • Start date Start date
J

Jamie

I want to have a button that when pressed it reflects the following event:
// Check if the user presses the action key

protected override void OnKeyDown(KeyEventArgs e)
{
switch(e.KeyCode)

{

case Keys.Return:

.................



So on my windows mobile application when the user presses key 2, it would be
the same as pressing the return key. How can I do this ?



Many thanks.
 
Hi,

What you can do is call the button_Click on your event.

protected override void OnKeyDown(keyeventsargs e)
{
Button_Click(this, null);
}
 
Back
Top