By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,184 Members | 1,546 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,184 IT Pros & Developers. It's quick & easy.

Re: Trap keyup event in canvas

P: n/a
>I have a canvas which I use for dragging shapes around such as rectangles
>and polylines. I can use the mouse down event on these objects to give
them a selected appearance, but I can't trap the keyup event. I need to
trap the keyup event so if the user used the delete key, I can remove the
object from the canvas (as a user would expect to do). I attached a simple
project which as a canvas and a few shapes in it. can someone please
advise on how I can trap a keyup event on these shapes?
Add
Focusable="True"
to the XAML for the PolyLine and Rectangle elements and then when you set
the focus to them they will receive the KeyUp events.

Chris Jobson
Jun 27 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Thanks Chris, this worked nicely.
"Chris Jobson" <ch**********@btinternet.comwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
I have a canvas which I use for dragging shapes around such as rectangles
and polylines. I can use the mouse down event on these objects to give
them a selected appearance, but I can't trap the keyup event. I need to
trap the keyup event so if the user used the delete key, I can remove the
object from the canvas (as a user would expect to do). I attached a
simple project which as a canvas and a few shapes in it. can someone
please advise on how I can trap a keyup event on these shapes?

Add
Focusable="True"
to the XAML for the PolyLine and Rectangle elements and then when you set
the focus to them they will receive the KeyUp events.

Chris Jobson

Jun 27 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.