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.

Deleting symbol from a diagram - delete key doesn''t work

Thread ID:

Created:

Updated:

Platform:

Replies:

30653 Jun 21,2005 11:44 AM Jun 22,2005 06:17 PM Windows Forms 2
loading
Tags: Diagram
Richard Deverson
Asked On June 21, 2005 11:44 AM

Hello, The delete key no longer works in my diagram component. I tried it also with the Custom Symbol Sample, and it doesn''t work here either. However the diagram builder sample works OK. In the Custom Symbol Sample, the Diagram_ChildrenChanging event is fired when I insert a symbol, but not when I press the delete key. I.e. it is impossible to delete the symbol. In the Custom Symbol Sample, the keypress event is not even fired when I press the delete key. By the way, this is on a W2k machine. Is this the intended behaviour? Thanks Richard

Richard Deverson
Replied On June 22, 2005 08:24 AM

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?

Administrator [Syncfusion]
Replied On June 22, 2005 06:17 PM

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?

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.

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.

;