We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Move symbols programmatically...

Thread ID:

Created:

Platform:

Replies:

36353 Oct 27,2005 02:03 PM UTC Windows Forms 0
loading
Tags: Diagram
Alexander Riske
Asked On October 27, 2005 02:03 PM UTC

Hello, I would like to write an EventHandler to process KeyDown-Events and to move selected shapes with arrow keys on the keyboard. I''ve tried out following: this.diagramComponent = new Syncfusion.Windows.Forms.Diagram.Controls.Diagram(); this.Controls.Add(this.diagramComponent); this.diagramComponent.KeyDown += new System.Windows.Forms.KeyEventHandler(this.diagramComponent _KeyDown); private void diagramComponent_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e) { switch(e.KeyCode) { case Keys.Up: Syncfusion.Windows.Forms.Diagram.NodeCollection selNodes = new NodeCollection(); selNodes = this.diagramComponent.SelectionList; foreach (INode curNode in selNodes) { string childName = curNode.FullName; Syncfusion.Windows.Forms.Diagram.INode tmpNode; tmpNode = this.diagramComponent.Model.GetChildByName(childName); Syncfusion.Windows.Forms.Diagram.MoveCmd moveNodes = new MoveCmd(0, 1); moveNodes.Nodes.Add(tmpNode); } break; case Keys.Down: MessageBox.Show("DOWN"); break; case Keys.Left: MessageBox.Show("LEFT"); break; case Keys.Right: MessageBox.Show("RIGHT"); break; } base.OnKeyDown (e); } But nothing is happened. I guess there is either something wrong with EventHandler or this is the wrong way to move symbols. Has anybody already solved a similar issue like this one?

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;