Solved

CDragListBox, can't drag to end of list.

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Named range not carried over 10 61
Excel Use VBA to get user's Mac Address for their computer 5 107
sumDigits challenge 9 120
Problem to event 3 74
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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 demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

948 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

18 Experts available now in Live!

Get 1:1 Help Now