Raising an Event

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.
 
G

Guest

Hi,

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

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

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