Solved

CDragListBox, can't drag to end of list.

Posted on 1997-09-26
2
304 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…

724 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