none
DoDragDrop() calls BeforeDoubleClick event if double click was previous action RRS feed

  • Question

  • Hi all;

    Ok, here's a weird one. If the user double clicks in Word, we have a double click event where we handle the double click. If the next thing the user does is start a drag drop from our AddIn where we call Control.DoDragDrop, then once we drag over the document (no drop yet), it calls our double click event handler and then pops up a zillion copies of the Page Setup dialog box until it hits a stack overflow.

    Any idea what's going on and how to avoid this?

    thanks - dave


    The Programming Olympics - Code Wars
    Thursday, November 3, 2011 8:07 PM

Answers

  • Hello,

     

    How to avoid: A way to avoid it would be to force something automatic in the document (like a selection) before the dragdrop begins, or to use a flag system that will allow/deny any undesired code to run while a specific progress is happening.

    Why it happens: the cause could be that the event does not have a chance to trigger itself and it remains dormant untill something wakes it up. I also face this problem on many ocasions unfortunatelly (with the OnContentCOntrolEnter/OnContentControlExit events in particular).

    Best regards,

    Silviu.


    http://www.rosoftlab.net/
    • Marked as answer by DavidThi808 Friday, November 4, 2011 3:12 PM
    Friday, November 4, 2011 6:04 AM

All replies

  • Hello,

     

    How to avoid: A way to avoid it would be to force something automatic in the document (like a selection) before the dragdrop begins, or to use a flag system that will allow/deny any undesired code to run while a specific progress is happening.

    Why it happens: the cause could be that the event does not have a chance to trigger itself and it remains dormant untill something wakes it up. I also face this problem on many ocasions unfortunatelly (with the OnContentCOntrolEnter/OnContentControlExit events in particular).

    Best regards,

    Silviu.


    http://www.rosoftlab.net/
    • Marked as answer by DavidThi808 Friday, November 4, 2011 3:12 PM
    Friday, November 4, 2011 6:04 AM
  • Oh lovely.

    Ok thanks - will do.


    The Programming Olympics - Code Wars
    Friday, November 4, 2011 3:12 PM