Item editing in list views [Win32]

Started by
1 comment, last by GameDev.net 18 years ago
Do list views support item editing? I know Explorer uses list views for displaying directories, and you can edit the first column. So is there a way to enable this? Or do I have to implement my own cell editing mechanism?
Advertisement
You have to do it yourself. It is pretty easy though. On your edit start event (doubleclick, F2) you check the current item (plus subitem) and place an edit control there. If you're not using MFC you may need to subclass the edit's winproc to catch a few special keys like enter or escape to stop editing. Everything else ought to be managed by catching the EN_x-messages.

You also may want to disable the listview while the edit is opened to disable scrolling (with mousewheel).

Fruny: Ftagn! Ia! Ia! std::time_put_byname! Mglui naflftagn std::codecvt eY'ha-nthlei!,char,mbstate_t>

Editing of a listview item's label, i.e., the first column's text, is easily done through the handling of the built-in listview WM_NOTIFY notification msgs, namely LVN_BEGINLABELEDIT and LVN_ENDLABELEDIT. this will get you the equivalent of what Explorer does.

This topic is closed to new replies.

Advertisement