cancel
Showing results for 
Search instead for 
Did you mean: 

how to enable dragdrop for listbox?

Former Member
0 Kudos

I want to dragadrop for a listbox. I enable property DragAuto. Then the drogdrop is for the whole listbox,  And I can't select any item in the listbox anymore.

but I want dragdrop for single selected item. How to to it?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Kent;

   You would need to use the "manual drag" feature of PB.

1) Make sure Drag Auto is OFF

2) Add a User Event and map it to the MouseMove message (pbm_mousemove)

3) On the UserEvent ... use the DRAG ( ) method as follows  ...

//Check to see if mouse button is down

If flags = 1 Then

  This.Drag( Begin!)

End If

This should leave the normal behavior of the DDLB alone until an actual dragging action is started by the user.  

HTH

Regards ... Chris

Former Member
0 Kudos

thanks. it looks like working. then how to get the dragged(selected) item when drop it in another pb object? and what's the method DRAG() you mentioned?

Former Member
0 Kudos

Easy ...

1) Use the DragDrop Event

2) Add code to see what was dropped ...

For example - save DDLB's TAG in the dropped objects TEXT property

CHOOSE case source.Typeof ( )

    case DropDownListBox!

        DropDownListBox    lo_dddlb

        lo_dddlb        =     Source

        THIS.tag        =    lo_dddlb.text

    case else

        MessageBox ("Ouch", "Wrong object!")

end choose

HTH

Regards .. Chris

Answers (0)