Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to detect Ctrl+V in Silverlight 4?

What is the best way to detect Ctrl+V in Silverlight?

I want to detect Ctrl+V, to get access to the Clipboard.

like image 765
eflles Avatar asked Jun 02 '10 06:06

eflles


1 Answers

if (e.Key == Key.V)
{
    if ((Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control)
    {
        //do what you want on paste
    }
}

You have to use this on the keyUp event. More details can be found here: http://msdn.microsoft.com/en-us/library/cc189015%28VS.95%29.aspx

like image 63
user386956 Avatar answered Nov 16 '22 20:11

user386956