Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic delete attached objects (Read 1321 times)
AlanShen
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 1
Joined: Feb 8th, 2007
delete attached objects
Feb 8th, 2007 at 5:27pm
Print Post  
I create a box and attached a rectangle, decision and a arrow to link the rectangle and decision. I want to delete all the 4 objects when delete 1 of them (eg, select the arrow or rect then hit the Del key)? How to do this.  ???
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: delete attached objects
Reply #1 - Feb 8th, 2007 at 6:08pm
Print Post  
Hi,

If you are using the code that my coworker emailed you today, you can do the following before returning from StartDraw:

rect.Locked = decision.Locked = arrow.Locked = true;
container.SubordinateGroup.AutoDeleteItems = true;

Now if a user clicks on any of the attached items, the container will be selected. Hitting Del will delete all items in the container when using AutoDeleteItems.

Another possibility is to handle the BoxDeleted and ArrowDeleted event, and detect if the deleted item is part of the container. If so, delete the other objects in the group using the FlowChart.DeleteObject method.

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