Click to See Complete Forum and Search --> : How to create editable ListBox?


Leaner
May 23rd, 1999, 10:21 PM
How to create a editable ListBox?

Troy T
May 23rd, 1999, 10:24 PM
What exactly do you mean by "editable"? That will help us help you much more effectively. :)

- Troy

May 24th, 1999, 04:00 AM
Hi,

I think you mean you want to edit individual lines...yes

Now, I don't know how to do this directly ...but I would like to, so please let me know if you find out...mail stewart_duffill@hotmail.com.........however, I know a way to get around it,

create an edit box, when you click an item in your list, send the text to the edit control, make ammendments, and let the return key send it back to the list. As if by magic the list changed.

Jason Teagle
May 24th, 1999, 04:16 AM
How about using a CListCtrl insead? It is fairly easy to add a handler for when an item is clicked or double-clicked, the same as a normal list box.

May 24th, 1999, 07:16 AM
Hi Stewart here, I, ve used some list controls but, unlike yourself, I don't see how I make the line edit. My handlers for click etc select the line thats all. Why?

Jason Teagle
May 24th, 1999, 07:28 AM
Sorry, I wasn't implying that you SHOULD know how to make them editable; I have not used this feature on them myself yet - but I know it can be done.

You need to add LVS_EDITLABELS to the style when the control is created, and then add a handler for the '=LVN_ENDLABELEDIT' message from your list view (if you are using one - if not, then the LVN_ENDLABELEDIT for the list control itself). This notifies you when the user has finished or cancelled the edit. The help will provide more details of LVN_ENDLABELEDIT, but I'd be happy to help more if you want.