Click here to Skip to main content
15,889,838 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
C++ Code to move selected item from one list-box to another list-box...
I hope for a solution code in Borland C/C++ compiler or Dev C++ Compiler and not in any other advanced C programming languages such as C#...

Thanks in advance...
Posted
Comments
enhzflep 16-Mar-12 4:52am    
This task is really quite easy. Though, clearly from your question - it's not something you're familiar with. I won't provide you with a solution, BUT I will give you the list of functions/messages needed.

Functions:
SendMessage
malloc/calloc/new (any 1)
free/free/delete (any 1 - matching mem alloc function used)

Messages:
LB_GETCURSEL
LB_GETTEXTLEN
LB_GETTEXT
LB_DELETESTRING
LB_ADDSTRING
Richard MacCutchan 16-Mar-12 5:47am    
Don't forget LB_GETITEMDATA and LB_SETITEMDATA, as they may also be required.

I don't use either of the languages you mention, but this should just be a case of copying the item data from one listbox to the other, and then deleting it from the original. Or is there something more to this question that I have missed?
 
Share this answer
 
Comments
JackDingler 15-Mar-12 18:24pm    
Yeah that's how you do it.

Get the text and item data from the source box, insert into the destination box, then remove the entry from the source.

Smells like homework.
Copy selected item from list control1 and remove it. Then add these items to the second list control. Simple. If you need the code in mfc, let me know
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900