Solved

CDragListBox, can't drag to end of list.

Posted on 1997-09-26
2
258 Views
Last Modified: 2013-11-19
I'm using the CDragListBox. I can't drag an item to the end of the list. I have to drop it one up from the end and then drag the last item up above it.  What might I be doing wrong?
0
Comment
Question by:kenraliegh
2 Comments
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 200 total points
ID: 1307034
I don't think you're doing anything wrong. Looking at the source for CDragListBox, the virtual function Dropped() is called when you drop the items. However, if you look at the source for the function, there is a call to ItemFromPt() that tries to determine what the source and destination indexes are. If any of them is -1 (which means outside the range), then the function does not do anything. You should override this function in your subclass of CDragListBox and do something more intelligent when you drop it at the bottom.
0
 

Expert Comment

by:zentig
ID: 1307035
A simple but not very elegant solution is to put a blank item at the end of the list. The Dropped() function can be overridden to prevent dropping the blank item if it's dragged. This will ensure that the last item is always blank.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now