I am trying to program drag and drop from a multi-select List Box to a
image.
I have the BeginDrag(false) in the listBox.MouseDown event.
But after doing that I am no longer able to ctl-click multiple items from
the list box.
You can get multiple items if you go click crazy on the ListBox otherwise
the item becomes marked as active but not selected.
Has anyone run into this problem before. Is there a solution.
Thanks,
DJ McNeill
cn...@chevron.com
Don't call BeginDrag on *every* MouseDown, only call it if no modifier key
is pressed as well. That is: check (Shift and [ssCtrl, ssShift]) = []) and
of course only drag if Button = mbLeft.
Peter Below (TeamB) 10011...@compuserve.com)
No e-mail responses, please, unless explicitly requested!
Thank you for your suggestion. At first I thought it would solve the
problem but then I wasn't sure. So I tried it.
Drag and Drop certainly is not enabled on all button clicks but now I can
not select multiple items and drag and drop them because if I release the
ctrl key and click the list box, it clears the selected items and selects
the one item and enables drag and drop.
Thanks again for the suggest but can you think of a way around this problem.
DJ
Peter Below (TeamB) <10011...@compuXXserve.com> wrote in message ...
Do not call the inherited MouseDown method if you have started a drag. If that
does not solve the problem you have to go one level deeper and handle the
WM_LBUTTONDOWN message directly. There you should be able to shallow it by not
calling the inherited handler.
Not that I'm the expert, but can't you either set DragMode to
dmAutomatic, or change your call to
BeginDrag(False, 5)
? " If Immediate is False, the mouse pointer doesn't change to the
value of the DragCursor property and dragging doesn't begin until the
user moves the mouse pointer a short distance (the number of pixels
specified by Threshold). This allows the control to accept mouse clicks
without beginning a drag operation."
--
Steve
|~ |~
>^..^< >^..^<