Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Event for LinkCreating Issue (Read 1524 times)
chris
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 57
Joined: Feb 1st, 2008
Event for LinkCreating Issue
Mar 12th, 2009 at 5:44pm
Print Post  
Hi Stoya,

I have some validation code in the LinkCreating event handler. I set e.Cancel to true and display a message box if the link is not allowed.

The problem is that the LinkCreating event is raised
more than onece and the message box is shown 2 times.

How can avoid this? Thanks a lot.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Event for LinkCreating Issue
Reply #1 - Mar 13th, 2009 at 7:09am
Print Post  
Hi,

You could call e.CancelDrag() to stop the link creation completely. Otherwise LinkCreating is raised for each mouse move, and setting e.Cancel = true just changes the cursor to the Stop icon, and has the effect of cancelling the operation only when raised for the last time (after the mouse button is released). So, another way to handle this is show the message box only if you detect that the mouse button state is 'up'.

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