Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Delete a shape node (Read 2612 times)
Anshul
Senior Member
****
Offline


I love YaBB 1G - SP1!

Posts: 316
Joined: Apr 3rd, 2009
Delete a shape node
Apr 14th, 2009 at 4:20pm
Print Post  
Hi Stoyan,

On mouse click over the diagram, I want to delete active node.This node is a simple ShapeNode.
How I can do this?

Thanks,
Anshul
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Delete a shape node
Reply #1 - Apr 14th, 2009 at 5:05pm
Print Post  
If you want to delete the clicked node, do this from the NodeClicked event handler:

diagram.Items.Remove(e.Node);

or to delete the so-called active item from the Diagram.Clicked handler:

diagram.Items.Remove(diagram.ActiveItem);

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Anshul
Senior Member
****
Offline


I love YaBB 1G - SP1!

Posts: 316
Joined: Apr 3rd, 2009
Re: Delete a shape node
Reply #2 - Apr 15th, 2009 at 9:39am
Print Post  
when i clicked on diagram,No item behave as activeitem, so i didn't get any activeitem so how can i remove that item which was active item before click on the diagram ???
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Delete a shape node
Reply #3 - Apr 15th, 2009 at 11:08am
Print Post  
Ok, the selection is cleared when you click on the diagram. You could handle the NodeActivated event and save a reference to the last active node in some variable of the form. You might as well call diagram.Nodes.Remove(e.Node) from NodeDeactivated, but NodeDeactivated might be raised in other situations too, and not only when clicking on the diagram.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint