Link to home
Start Free TrialLog in
Avatar of gunn
gunn

asked on

Drag/Drop from on ListBox to another?

I'm using MFC, and trying to figure out how (or if its possible) to be able to drag an item from one CListBox and drop it in another CListBox.

I created a sample app to figure this out that has just 2 ListBox's using the resource editor. But I just can't seem to figure it out whatsoever! Any help, or sample code/project, etc? I'm not all that experienced in this type of thing.....

Thanks ;)
Avatar of naveenkohli
naveenkohli

Look at this sample project... its for tree control and list control. but you will get the idea on how to accomplish it for list box..


SAMPLE: MFCDRAG Implements Drag&Drop Between CListCtrl & CTree

http://support.microsoft.com/support/kb/articles/q148/7/38.asp
Also look at the use of CDragListBox usage... although it is for drag and drop with in same ListBox.
Avatar of gunn

ASKER

According to: http://www.codeguru.com/mfc/comments/7446.shtml

CListBox is not a type of CView, so it will never work this way! The example at the MS site shows both being a type of CView.....
ASKER CERTIFIED SOLUTION
Avatar of vachooho
vachooho
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Have you got the draging from list box to list box figureed out? I'm just
now looking at the same thing. Any suggestions? It looks pretty messy to
me...

Dave P