Link to home
Start Free TrialLog in
Avatar of wpm0001
wpm0001Flag for United States of America

asked on

AaronReams ListView to ListView drag and drop as something that can be inherited?!

I'm using VS2005 and have a C# inheritance question for listview drag and drop abilities.  AaronReams provided a nice drag and drop bit from listview to listview and that is what I need.  It is entitled "Drag and drop jumpstart".   I have several mdi child forms in my app and all of them have two listviews that need this ability so I'd like each listview to inherit the ability.  How does that work?  I understand the concept but creating something that can be inherited is somehow beyond my grasp.  

Please - can someone put AaronReams listview to listview drag and drop code into a form that can be inherited?  I've been beating my head against my desk for like two days on this one!  If I see what I have and then the answer - man - that would be soooooo nice!

Thanks!

Will
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Well, let's look at the requirements to start with:

1) Set AllowDrop = True

2) Process MouseMove to see if the left button is down to begin drag/drop operation

3) Set the e.Effect in the DragOver event handler

4) Handle the DragDrop event

Is there anything missing in that list?

Bob
Avatar of wpm0001

ASKER

Hi TheLearnedOne
Well, other than removing the dragged listitems from the source listview I think that is all.  Man - sure sounds easy when you type it...
Avatar of wpm0001

ASKER

LearnedOne,

Were those four points intended to be a solution to creating a listview custom control with drag drop functionality that can be inherited?

Just Checking...
Avatar of wpm0001

ASKER

No insult intended Bob.  My initial question was a rambling one because I was a bit frustrated with this inheritance thing.

If I ticked you off please let me know and I'll award the points out of pure shame...

Will
ASKER CERTIFIED SOLUTION
Avatar of Bob Learned
Bob Learned
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
Avatar of wpm0001

ASKER

Hey Bob - This really helps!

Your example doesn't actually work but the comments are great!

As far as a beginning of understanding goes this is gold.  I don't know why I couldn't "get" this reading a book.  I used to be a pretty good at applying reading to reality...

Any idea why the drop item throws an exception?

Will
What exception did you get?

Bob