License

Share

About the Author

Alan has been developing applications for a very long time (~10 years), but he's not bitter about this at all. My main area of expertise is C++. He lives in Sweden with his beautiful wife, daughter and son and enjoys climbing mountains and kayaking in his spare time (which isn't much).

Someone should post a VC6 version of this.Eventually I end up with this error:c:\documents and settings\tmarshall\my documents\download\treectrl\treectrl.h(99) : error C2664: 'Add' : cannot convert parameter 1 from 'struct _TREEITEM *' to 'struct _TREEITEM *& ' A reference that is not to 'const' cannot be bound to a non-lvalue

I had downloaded and build it, the tree control 's item text can't display fully when I launch it and choice "TheMe". My OS is chinese XP, It display normally when i change the Dialog template's language property to chinese.

Start the program then click on the first item. The selection disappears.

Get the selection back on the first item, then Shift+Click further down. The section incorporates everything from the second clicked item to the bottom of the tree.

Select the first three items using Ctrl+Click, then Shift+Click the somewhere further down. The first item is not de-selected.

Use the arrow keys to move up and down the tree. At the top and bottom, the selection disappears if you hold the key down. The same happens if you use the left and right arrow keys to expand or collapse a node.

Put checkboxes into the tree using the dialog editor. Pressing the space bar will only flip one checkbox out of the selection, and the selection goes away.

I think that the custom painting is great, and I want to use it, but the multiple selection functionality needs a lot of work. I did a bit to address a few of these, but it's going to take more, I think.

Thanks for your work, But I find a bug, you miss MSG_WM_CREATE(OnCreate) in message map, so if create a treeCtrl in a window at runtime not in a dialog at design time, the treeCtrl display isn't right!