Drag-n-drop

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dmitry Karneyev

    #1

    Drag-n-drop

    Hi!
    I use OnMouseDown event to begin drag-n-drop in listbox
    but when I call to ListBox.DoDragD rop(params) OnDoubleClick event is not
    working.
    What I need to do to force OnDoubleClick work?

    Thanks.


  • Dmitry Karneyev

    #2
    Re: Drag-n-drop

    Hi!
    I've sorted out it.

    I was useing the following OnDoubleClick event holder
    if(e.Button == MouseButtons.Le ft )

    Object obj = new Object();

    listGoods.DoDra gDrop(obj, DragDropEffects .Copy | DragDropEffects .Move);

    }

    it causes that OnDouble click event doesn't work. DoDragDrop elimanates it

    Solution is to watch how many times mouse was clicked my using e.Clicks
    property if it's one time - it's our case:

    if(e.Button == MouseButtons.Le ft && e.Clicks == 1 )

    Object obj = new Object();

    listGoods.DoDra gDrop(obj, DragDropEffects .Copy | DragDropEffects .Move);

    }

    Hope it might be usefull for someone.

    "Dmitry Karneyev" <karneyev@msn.c om> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ ÓÌÅÄÕÀÝÅÅ:
    news:upEmR7soDH A.1284@TK2MSFTN GP09.phx.gbl...[color=blue]
    > Hi!
    > I use OnMouseDown event to begin drag-n-drop in listbox
    > but when I call to ListBox.DoDragD rop(params) OnDoubleClick event is not
    > working.
    > What I need to do to force OnDoubleClick work?
    >
    > Thanks.
    >
    >[/color]


    Comment

    Working...