Silverlight Canvas does not support KeyDown?

I have this:


In the newly launched Ag 3 application in VS2008. I just changed the default to and added a KeyDown handler that pops up the MessageBox. < /p>

But no matter how I try, the KeyDown event will never happen.

It’s just that doesn’t support KeyDown or what am I doing wrong?

You need to have at least some focusable things in Canvas, you will find that events will Come out.

You may also want to set IsHitTestVisible = “True” on Canvas.

I have this:

< /p>


Newly launched Ag in VS2008 3 application. I just changed the default to and added a KeyDown handler that pops up the MessageBox.

But no matter how I try, the KeyDown event never happens.

It’s just that does not support KeyDown or what am I doing wrong?

You need to have at least some focusable things in Canvas, you will find events will pop up.

You may also want to set IsHitTestVisible = “True” on Canvas.

Leave a Comment

Your email address will not be published.