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!
Alberto Silva
"Lcubed" <loris.e...@gmail.com> escreveu na mensagem
news:fd77c489-d39c-4c02...@p8g2000yqb.googlegroups.com...
> __________ Information from ESET NOD32 Antivirus, version of virus
> signature database 4591 (20091110) __________
>
> The message was checked by ESET NOD32 Antivirus.
>
> http://www.eset.com
>
>
>
__________ Information from ESET NOD32 Antivirus, version of virus signature database 4591 (20091110) __________
The message was checked by ESET NOD32 Antivirus.
I set the variable as soon as the dialog is instantiated.
public MyDialog()
{
InitializeComponent();
// tried putting this in InitializeComponent as well
// doesn't work either way
this.KeyPreview = true;
this.KeyUp += new KeyEventHandler(Form_KeyUp);
}
I've also tried KeyDown and KeyPress with the same results.
On Nov 10, 6:39 am, "Alberto Silva, MVP"
<albertosi...@mundomovel.removeuntildot.com> wrote:
> Are you sure that you have the KeyPreview form property of the 2nd dialog
> set to True?
>
> Alberto Silva
>
> "Lcubed" <loris.email...@gmail.com> escreveu na mensagemnews:fd77c489-d39c-4c02...@p8g2000yqb.googlegroups.com...
Any ideas?
Thanks!
Alberto Silva
"Lcubed" <loris.e...@gmail.com> escreveu na mensagem
news:59c34687-f1bd-4de9...@15g2000yqy.googlegroups.com...
> __________ Information from ESET NOD32 Antivirus, version of virus
> signature database 4599 (20091112) __________
>
> The message was checked by ESET NOD32 Antivirus.
>
> http://www.eset.com
>
>
>
__________ Information from ESET NOD32 Antivirus, version of virus signature database 4603 (20091113) __________
The keys I'm looking for are the four application keys on the front of
the unit, like an Acer, HP iPaq, NEC, Toshiba, Socket, etc... WIndows
Mobile PPCs that don't have a hard key keyboard built in, but do have
an arrow pad and four application keys on the front of the unit. I can
catch the keypad keys but not the application keys.
On Nov 13, 5:52 am, "Alberto Silva, MVP"
<albertosi...@mundomovel.removeuntildot.com> wrote:
> Hi,
> It's strange that you can catch only some keys... what are the application
> keys you are talking about, is it a specific device?
>
> Alberto Silva
>
> "Lcubed" <loris.email...@gmail.com> escreveu na mensagemnews:59c34687-f1bd-4de9...@15g2000yqy.googlegroups.com...