Handeling KeyDown for controls doesn't work.??

M

Mustafa Rabie

hi all
i have added this code to my application to handel the key evens when a
control on my form has a focus, but whenever i click on the control, my code
is not excuted and the normal code for the control is, i set a break point
at the function entry and the code didn't break at it. i am using the
following code:

private void checkBox1_KeyDown(object sender,
System.Windows.Forms.KeyEventArgs e)

{

if (e.KeyCode == Keys.Enter)

{

System.Windows.Forms.MessageBox.Show("Action KeyDown on
CheckBox","Hellooo");

}

else

{

System.Windows.Forms.MessageBox.Show("Anyother keyDown CheckBox","Hellooo");

}

e.Handled = true;

}

if anyone can help i'd really appreciate it

Mustafa
 
M

Mustafa Rabie

I downloaded and installed SP3, but it's not supported by Smartphone 2003.
Has anyone tried handeling KeyDowns for controls that can help with this?

?Thanks
Mustaga
Sergey Bogdanov said:
Make sure that you have installed the latest SP
(at this moment it is SP3 [1]). In the SP2 were changes concerning KeyUp,
KeyDown, KeyPress for all controls [2].

[1]
http://www.microsoft.com/downloads/...11-194b-4c00-b445-f92bec03032f&displaylang=en
[2]
http://www.microsoft.com/downloads/...da-fc5d-41cc-ac04-7bb50a134556&DisplayLang=en


Best regards,
Sergey Bogdanov
http://www.sergeybogdanov.com

Mustafa said:
hi all
i have added this code to my application to handel the key evens when a
control on my form has a focus, but whenever i click on the control, my
code is not excuted and the normal code for the control is, i set a break
point at the function entry and the code didn't break at it. i am using
the following code:

private void checkBox1_KeyDown(object sender,
System.Windows.Forms.KeyEventArgs e)

{

if (e.KeyCode == Keys.Enter)

{

System.Windows.Forms.MessageBox.Show("Action KeyDown on
CheckBox","Hellooo");

}

else

{

System.Windows.Forms.MessageBox.Show("Anyother keyDown
CheckBox","Hellooo");

}

e.Handled = true;

}

if anyone can help i'd really appreciate it

Mustafa
 

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