Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Override default paste from keyboard (Read 1250 times)
PDM.
Senior Member
****
Offline


I love YaBB 1G - SP1!

Posts: 256
Joined: Dec 2nd, 2010
Override default paste from keyboard
Jul 17th, 2014 at 5:37am
Print Post  
By default i see component allow to copy and paste trough clasical and standard hot keys, ctrl +c and ctrl +v

I add this code:

private void formkeydown(object sender, KeyEventArgs e)
{
if (Keyboard.IsKeyDown(Key.LeftCtrl) && Keyboard.IsKeyDown(Key.V))
{
form.PasteFromClipboard(new Vector(20, 20));
e.Handled = true;
}

}

Anyway this not work, new node paste arround 8 pixels x y moved form original node.
Some sugestion?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Override default paste from keyboard
Reply #1 - Jul 17th, 2014 at 10:09am
Print Post  
You can override the built-in paste command like this:

Code
Select All
diagram.CommandBindings.Add(new CommandBinding(ApplicationCommands.Paste,
	(sender, args) => diagram.PasteFromClipboard(offset))); 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint