Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 10 Replies) Disabling Delete Key for flowcharts. (Read 14172 times)
sm323
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 9
Joined: Aug 17th, 2009
Disabling Delete Key for flowcharts.
Aug 18th, 2009 at 1:55am
Print Post  
Hi,

I need to disable the delete key in box control  in winforms. Could someone provide some info.

Thanks
SM
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Disabling Delete Key for flowcharts.
Reply #1 - Aug 18th, 2009 at 5:50am
Print Post  
Hi,

Set DiagramView.DelKeyAction = None.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
sm323
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 9
Joined: Aug 17th, 2009
Re: Disabling Delete Key for flowcharts.
Reply #2 - Aug 18th, 2009 at 1:56pm
Print Post  
I am trying to do the folowing but I am unable to set the property.

MindFusion.Diagramming.WinForms.Box test = new Box();
           
           MindFusion.Diagramming.WinForms.FlowChart tt = new MindFusion.Diagramming.WinForms.FlowChart();

Where I have to set the property?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Disabling Delete Key for flowcharts.
Reply #3 - Aug 18th, 2009 at 4:04pm
Print Post  
DelKeyAction was added to v5.0.2 of the control; seems you are using an older version. You could handle the ArrowDeleting and BoxDeleting validation events to prevent deleting the items.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
sm323
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 9
Joined: Aug 17th, 2009
Re: Disabling Delete Key for flowcharts.
Reply #4 - Aug 18th, 2009 at 4:10pm
Print Post  
Is there a sample that I can look at?
  
Back to top
 
IP Logged
 
sm323
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 9
Joined: Aug 17th, 2009
Re: Disabling Delete Key for flowcharts.
Reply #5 - Aug 18th, 2009 at 4:12pm
Print Post  
I am using v2.0.50727.

We have inherited box control and created a node and now we want to disable the delete key action.

Are there events I can use to disable the action?

SM

  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Disabling Delete Key for flowcharts.
Reply #6 - Aug 18th, 2009 at 4:16pm
Print Post  
There should be BoxDeleting and ArrowDeleting validation events raised when the user presses Del.

Stoyan
  
Back to top
 
IP Logged
 
sm323
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 9
Joined: Aug 17th, 2009
Re: Disabling Delete Key for flowcharts.
Reply #7 - Aug 18th, 2009 at 4:22pm
Print Post  
Are there any properties I have to set on those events? or I have to cancel the event?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Disabling Delete Key for flowcharts.
Reply #8 - Aug 18th, 2009 at 5:11pm
Print Post  
If I remember correctly, in older versions you would have to set e.Allow = false. Later we started using the standard .NET validation scheme where you set e.Cancel = true to prevent the operation. I think v2.0.50727 that you mention is the .NET runtime version, and not the Flowchart.NETs' one, so I'm not sure what you should use.
  
Back to top
 
IP Logged
 
sm323
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 9
Joined: Aug 17th, 2009
Re: Disabling Delete Key for flowcharts.
Reply #9 - Aug 18th, 2009 at 5:42pm
Print Post  
I am not having e.allow or e.cancel property.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Disabling Delete Key for flowcharts.
Reply #10 - Aug 19th, 2009 at 6:01am
Print Post  
Seems it was called e.Confirm; set it to false to prevent deleting the items.
  
Back to top
 
IP Logged
 
sm323
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 9
Joined: Aug 17th, 2009
Re: Disabling Delete Key for flowcharts.
Reply #11 - Aug 19th, 2009 at 1:30pm
Print Post  
I am trying using the following way
private void FlowChart_BoxDeleting(object inSender, BoxEventArgs inEvent)
       {
         
           
           return;
           
       }

I couldn't see any of the options that you are telling me to try.

Thanks
SM
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Disabling Delete Key for flowcharts.
Reply #12 - Aug 19th, 2009 at 3:10pm
Print Post  
Set inEvent.Confirm = false.
  
Back to top
 
IP Logged
 
sm323
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 9
Joined: Aug 17th, 2009
Re: Disabling Delete Key for flowcharts.
Reply #13 - Aug 19th, 2009 at 3:15pm
Print Post  
There is no confirm option.
  
Back to top
 
IP Logged
 
sm323
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 9
Joined: Aug 17th, 2009
Re: Disabling Delete Key for flowcharts.
Reply #14 - Aug 20th, 2009 at 5:04pm
Print Post  
I was using wrong eventargs.

I changed to the following
private void FlowChart_BoxDeleting(object inSender, BoxConfirmArgs inEvent)
       {
           inEvent.Confirm = false;
}   

Thanks
SM
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint