The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
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?