Solved

CDragListBox, can't drag to end of list.

Posted on 1997-09-26
2
291 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

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…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.

856 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