L
Lcubed
Hello, hoping some one can shed some light on this. I'm trying to
catch the hardware application keys.
I've tried the following code with and without KeyPreview. The
identical code works in another dialog. The dialog where the code
works is closed and disposed of before the dialog where the code
doesn't work is called.
this.KeyPreview = true;
this.KeyUp += new KeyEventHandler(Form_KeyUp);
void Form_KeyUp(object sender, KeyEventArgs e)
{
LogIt("KeyUp " + e.KeyCode.ToString()); // writes line to debug
file
}
I'm trying to catch the application keys and use a switch like this,
but the function is never entered for the application keys in dialog
that doesn't work. The working dialog captures all the keys.
switch ((HardwareKeys)e.KeyCode)
{
case HardwareKeys.ApplicationKey1:
// do stuff
break;
case HardwareKeys.ApplicationKey2:
// do stuff
break;
}
Does anyone have any ideas as to why this code would work in one
dialog but not in another one in the same application? I'm working
with WM 5.0, .NETCF 3.5.
Thanks for any suggestions!
catch the hardware application keys.
I've tried the following code with and without KeyPreview. The
identical code works in another dialog. The dialog where the code
works is closed and disposed of before the dialog where the code
doesn't work is called.
this.KeyPreview = true;
this.KeyUp += new KeyEventHandler(Form_KeyUp);
void Form_KeyUp(object sender, KeyEventArgs e)
{
LogIt("KeyUp " + e.KeyCode.ToString()); // writes line to debug
file
}
I'm trying to catch the application keys and use a switch like this,
but the function is never entered for the application keys in dialog
that doesn't work. The working dialog captures all the keys.
switch ((HardwareKeys)e.KeyCode)
{
case HardwareKeys.ApplicationKey1:
// do stuff
break;
case HardwareKeys.ApplicationKey2:
// do stuff
break;
}
Does anyone have any ideas as to why this code would work in one
dialog but not in another one in the same application? I'm working
with WM 5.0, .NETCF 3.5.
Thanks for any suggestions!