RD
Richard Deverson
June 22, 2005 12:24 PM UTC
It seems that if a symbol is programmatically created from a symbol model (with CreateSymbol()), then the delete key doesn''t automatically work. Or have I missed something here?
As a "workaround", I do this:
private void diagram1_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
{
if(e.KeyCode == Keys.Delete)
{
diagram1.Delete();
}
}
Is this the recommended solution?
AD
Administrator
Syncfusion Team
June 22, 2005 10:17 PM UTC
Richard,
Essential Diagram does not have built-in functionality for intercepting the delete key. You will have to handle the Diagram.KeyDown event and call the Diagram.Delete() method if the Delete key is pressed. Your implementation is correct.
The DiagramBuilder sample does not have a handler for the Diagram.KeyDown method only because it has a Delete menu item that specifies the Delete key as the shortcut key, and uses that command handler for invoking the Diagram.Delete() call.
Thanks,
Prakash Surendra
Syncfusion Inc.,
>It seems that if a symbol is programmatically created from a symbol model (with CreateSymbol()), then the delete key doesn''t automatically work. Or have I missed something here?
>
>As a "workaround", I do this:
>
>private void diagram1_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
>{
> if(e.KeyCode == Keys.Delete)
> {
> diagram1.Delete();
> }
>}
>Is this the recommended solution?