Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Move shapes with arrow keys (Read 2582 times)
himpact
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 11
Joined: Dec 9th, 2011
Move shapes with arrow keys
Dec 12th, 2011 at 4:53am
Print Post  
Hi,

Its there away to move the selected node(s) using the keyboard arrow keys?

Thanks

HL
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Move shapes with arrow keys
Reply #1 - Dec 12th, 2011 at 6:55am
Print Post  
Hi,

By default the framework does not raise KeyDown event for the arrow keys but PreviewKeyDown, so you can move nodes like this:

Code
Select All
private void diagramView_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
{
	if (e.KeyCode == Keys.Left)
	{
		DiagramNode node = diagram.ActiveItem as DiagramNode;
		if (node != null)
		{
			RectangleF bounds = node.Bounds;
			bounds.Offset(-5, 0);
			node.Bounds = bounds;
		}
	}
} 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
himpact
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 11
Joined: Dec 9th, 2011
Re: Move shapes with arrow keys
Reply #2 - Dec 13th, 2011 at 7:02am
Print Post  
Thank-You!!!
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint