key responses

  • Thread starter Thread starter Mustafa Rabie
  • Start date Start date
M

Mustafa Rabie

Hi,

I wanted to ask about how can i detect which button is pressed in
Smartphone2003? For example is it key 1,2,3,etc, is it the navigation
buttons.
Another thing can i interpret the "HOME" and "BACK" buttons? and if yes how?
when any of these keys is pressed i want my application to know and act
accordingly?

thx in advance
mustafa
 
Handle the KeyPress event on the form. I think Back and Home are Keys.Back
and Keys.Home, respectively.

protected void OnKeyPress(object sender, KeyPressEventArgs e)
{
switch(e.KeyChar)
{
case Keys.Home:
// do something
break;
}
}
 
Hi Ed,

I tried that but i got the following compilation error:
Cannot implicitly convert type 'System.Windows.Forms.Keys' to 'char'

I tried to use
KeyEventArgs e

with OnKeyDown but it didn't respond to the Home and Back keys, the system
override them.

Any suggestions?

Thanks
Mustafa
 
Back
Top