Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

D5- Drag and Drop and Multi-select List box

0 views
Skip to first unread message

DJ McNeill

unread,
Nov 22, 1999, 3:00:00 AM11/22/99
to
Hi,

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


Peter Below (TeamB)

unread,
Nov 25, 1999, 3:00:00 AM11/25/99
to
> 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.

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!


DJ McNeill

unread,
Nov 29, 1999, 3:00:00 AM11/29/99
to
Peter,

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 ...

Peter Below (TeamB)

unread,
Nov 30, 1999, 3:00:00 AM11/30/99
to
> 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.

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.

Steve Yates

unread,
Nov 30, 1999, 3:00:00 AM11/30/99
to
DJ McNeill <dj...@chevron.com> wrote in message
news:81c9m5$8p...@forums.borland.com...

> I have the BeginDrag(false) in the listBox.MouseDown event.

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

|~ |~
>^..^< >^..^<

0 new messages