Important alert: (current site time 7/16/2013 12:33:11 AM EDT)
 

article

cTreeView Class wrapper v02.03.00 (**Updated 16/8 - Animated Graphic TreeBack Demo - UNIQUE!**)

Email
Submitted on: 8/2/2002 2:19:06 PM
By: Slider 
Level: Intermediate
User Rating: By 98 Users
Compatibility: VB 6.0
Views: 63469
 
     ** Release 6 ** Added BackMode, BackColor, BackPicture, BackFileName, DisableMultiSelect, New Tutorial (Disable Multi-Node Select), updated Tutorial 1 (demonstrate new Back features) and added Animated TreeView Image Background (YES - A first! Pretty unique huh!). BackColor & BackPicture work independantly of the Nodes therefore Nodes maintain their original colors! No other VB code does this - enjoy! ** Release 5 - 26 New Features, 2 new Tutorials ** Now boasts 75 Properties & Methods (features), 7 tutorial/example applications and detailed Html help files and still growing! New features include:- **Disabled Nodes Interface** with full keyboard and mouse support (Unique!), HitTestEx (with comprehensive feedback), IsNodeTextUnique, IsPathExpanded, NodeAbsolutePosition, NodeAbsoluteIndex, NodeCoord, NodeCountChildren (recursively for all sub-branches), NodeFindEx1 (containing), NodeFindEx2 (advanced pattern-matching), NodeFindObjectInTag (advanced pattern-matching), NodePosition, NodeUniqueText, SubNodesSorted, and EditLabelMaxLength. The Disabled Nodes Interface allows individual nodes to be enabled/disabled (not selectable) and toggled with the ability to affect child nodes with a single command; disabled Fore/Back colours and Bold state are programmable (preserves the original Forecolor, Backcolor and bold status of each individual node) and fires a StateChange event when a node or a range of nodes are disabled/enabled. The treeview control by itself is a powerful control when used properly. This wrapper is designed to deliver the most common and also complicated features that's expected from the control but are not included or are very difficult to implement. [See the animated ScreenShots for examples of the new features] The included tutorials also demonstrate how to tie multiple ADO recordsets to a Treeview control with drag'n'drop automatic updates(move & copy nodes and branches), load-on-demand for instataneous display of large amounts of data; benchmarking; cursor management; TabStrip management; working with common dialogs through APIs; and much, much more...

This article has accompanying files

 
 
Terms of Agreement:   
By using this article, you agree to the following terms...   
  1. You may use this article in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this article (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this article from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the article or article's description.
				There is an update to this project that can be found at from  PSC!  Read decription for details on the 3 bugs fixed.

winzip iconDownload article

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.
  3. Scan the source code with Minnow's Project Scanner

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this article, you agree to the following terms...   
  1. You may use this article in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this article (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this article from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the article or article's description.


Other 18 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this article (in the Intermediate category)?
(The article with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments
8/2/2002 2:48:46 PMCarles P.V.

I wonder how you still can improve this...

Great, great work! (as usual)
(If this comment was disrespectful, please report it.)

 
8/3/2002 4:03:32 AMRobert Rayment

Overwhelming - you lucky people *****
(If this comment was disrespectful, please report it.)

 
8/3/2002 8:05:12 AMCoite Moss

Exceptional - All 5 Globes - No doubt this kills the TreeView control supplied with VB. Go away Microsoft, we have Slider.... If -all you need- is the Treeview this really reduces project distribution size.
(If this comment was disrespectful, please report it.)

 
8/5/2002 6:05:38 AMValenitn

I wonder if you can solve a problem with TreeView when visible part of the structure gets normalized by left points of nodes, thus hiding checkboxes under left side of TreeView panel. It's no problem while user controls tree by mouse, but very uncomfortable if checkboxes are needed and actions are controlled programmatically. The cure is API, of course, but the tricky part is it doesn't valid for all and every config. When I've tried it and consulted with some programmer, the same code did well on his config (VB6 SP3 or 4, NT), but failed on mine (Win 98, otherwise all the same). No crash, just doing nothing...
(If this comment was disrespectful, please report it.)

 
8/6/2002 11:52:53 AMspeedy5

I can't believe this code!! There's too many features that i can't possibly use them all! The one thing i learnt from your project was invaluable: preprocessor statements like #if. I didn't know vb had any until I saw your code. If only I could vote higher than a 5... :)
(If this comment was disrespectful, please report it.)

 
8/6/2002 12:19:45 PMspeedy5

I have a question, may I use this for my possibly commercial application (you will be given credit)? Please reply quickly.

Thanks,
Speedy
(If this comment was disrespectful, please report it.)

 
8/6/2002 8:39:45 PMSlider

Speedy5,

Thanks for your comments. I'm happy for you to use the code in your commercial app.
(If this comment was disrespectful, please report it.)

 
8/10/2002 8:19:43 PMSteve K

Awesome Dude. One of the best Treeviews I've seen to date. Your tutorial is great. It shows functionality extremely effectively. Five ++++
(If this comment was disrespectful, please report it.)

 
8/11/2002 1:11:08 AMSlider

Steve, Thanks for your comments & vote!

Much time has gone into this project & it's great to see the comments and votes - it's what tells me that I have to keep expanding the project with many new features.

There are a couple of guys (maybe the same one) that have casted Average votes with no feedback - I've posted them asking why but no response...

People, if you find the code useful, needs work, or have ideas that you'd like included, then please let me know!
(If this comment was disrespectful, please report it.)

 
8/12/2002 7:57:03 AMAndrew

very nice, 5 globes from me
(If this comment was disrespectful, please report it.)

 
8/12/2002 7:48:42 PMSlider

Andrew, Thanks for the support!
(If this comment was disrespectful, please report it.)

 
8/16/2002 8:16:35 AMmichael doering

Hello Slider,
>
what can I say, thanks to share this
very cool and useful app.
(If this comment was disrespectful, please report it.)

 
8/19/2002 12:36:17 PMPhantom Man

Nicely Done!

What I Would Like To See Is. When You Scroll The Tree The Picture Stays At It's Same Position.

It Gets A Bit Hard On The Eyes When Your Scrolling The Tree And The Picture Is Scrolling As Well.

Apart From My Pickiness Very Nicley Done!


(If this comment was disrespectful, please report it.)

 
8/19/2002 4:35:26 PMRasputin

Slider,

This is one of the best submissions ever offered on PSC - thank you for your generosity in sharing your hard work.

I'd give you a 6 globes if it was possible!!

Simply excellent!

- Ras
(If this comment was disrespectful, please report it.)

 
8/19/2002 4:43:38 PMRasputin

...one last thing.

The only thing that can explain votes of less than 5 globes for this is simply JEALOUSY!

Just take it as a compliment Slider, and keep up the great work!

- Ras
(If this comment was disrespectful, please report it.)

 
8/19/2002 8:41:54 PMK0d3r

Th1s 1s th3 m0st awsum th1ng h3r3! Gr3at w0rk Sl1d3r! 10********** if all0w3d!
(If this comment was disrespectful, please report it.)

 
8/20/2002 1:18:27 AMBart Goossens

Still the best ....
5 globes
(If this comment was disrespectful, please report it.)

 
8/26/2002 7:20:08 AMJohnB

Just what I've been looking for! Thank you from the bottom of my "up 'till 5 a.m." heart! Now my project will be complete!!! :) Thank you again!!!
(If this comment was disrespectful, please report it.)

 
8/30/2002 12:32:50 PMrufwork

Very nice work. One question -- any chance of getting multiline values (text wrapping that rewraps when the control is resized) displayed in a treeview node? Any pointers for where to look to learn how to add that? Thanks.
(If this comment was disrespectful, please report it.)

 
8/31/2002 10:59:53 PMBaal

Amazing what you can do with this control - Love yr work! 5*s - Keep it up!
(If this comment was disrespectful, please report it.)

 
9/4/2002 2:14:10 PMJason Curns

recieve error during .HookCtrl tvwDialog procedure that it is an invalid control, and that it must be a VB6 Tree View control.. Any Ideas?
(If this comment was disrespectful, please report it.)

 
9/4/2002 2:15:18 PMJason Curns

PS, I am using VB 6 SP5
(If this comment was disrespectful, please report it.)

 
9/5/2002 12:21:46 AMSlider

Jason, there are a couple of different versions of the MSCOMCTL.OCX file. As minor as they are, it's causing an the problem. Recompile the DLL and the problem will go away.
(If this comment was disrespectful, please report it.)

 
9/29/2002 8:05:18 PM

wow! great work, i have never seen anything betetr than this one. GReat great great
(If this comment was disrespectful, please report it.)

 
10/14/2002 2:26:16 PM

WOW - Great work!
Excellent code, for sure, but what makes your project worth MORE than 5 is your willingness to improve it based on feedback from users. Plus, of course, your very noble gesture of letting less-learned programmers (like me) benefit by seeing your work.

OUTSTANDING

THANK YOU * 100k

peace
/d
(If this comment was disrespectful, please report it.)

 
10/14/2002 2:32:18 PM

One more comment - the sign of a true professional and a really GREAT programmer, is attention to details.

Although the animated background is absolutely stunning! But honestly, I found the detail of .Tag that you did NOT overlook, to have been more useful!
The M$ treeview uses a string for .Tag, but you fixed their oversight and gave me a variant which is what I needed.


peace
/d

(If this comment was disrespectful, please report it.)

 
10/15/2002 11:32:21 PMSlider

'/d', Thanks for your comments. More features to follow shortly... Stay Tuned!
(If this comment was disrespectful, please report it.)

 
10/18/2002 9:48:46 PM

nice great
(If this comment was disrespectful, please report it.)

 
10/20/2002 4:51:11 AM

Great work. I like see what the possibilites are.
(If this comment was disrespectful, please report it.)

 
11/2/2002 12:55:11 AM

Slider...Excellent work. I can actually make sense out of this code. You got 5 globes from me....its saving me from 50 cups of coffee and a long frustrating weekend! True Pro. I'll have to send you a copy of the application that I'm using it in...
(If this comment was disrespectful, please report it.)

 
11/21/2002 4:02:09 AM

Look very good!

But I cannot try it, everytime I open the projects, this or that message comes out.

Is there any pre-requisite to install first?

I try to recompile the dll, but it gives me error:
Missing Microsoft XML V3.0



(If this comment was disrespectful, please report it.)

 
11/21/2002 5:54:20 AMSlider

There is a readme. Pls follow the instruction and it should fix the problems that you're experencing.
(If this comment was disrespectful, please report it.)

 
11/21/2002 12:05:41 PM

Slider : Outstanding!!!!. Thank you
(If this comment was disrespectful, please report it.)

 
11/24/2002 2:48:15 AM

Does it work in VBA (Word, Excel. ...) ?
(If this comment was disrespectful, please report it.)

 
12/14/2002 9:22:04 AMPeter Van der Straeten

Great control, dude. Just a tiny little glitch. You expose in the enum ECodeScrollView a constant named LEFT, this is a VB-Reserved word. It somehow interferes with normal use of vb LEFT function. I can't get my project to compile when i use your DLL. Solved it by renaming LEFT to KLEFT in the ENUM and function that uses the ENUM. Recomend you do the same.

scincerely

Peter
(If this comment was disrespectful, please report it.)

 
1/15/2003 4:41:34 AMAndy Bretl

I have seen some of controls of this kind during my carrer, but none of them was as excellent as this one is. It also finished off some missunderstanding of treeviews that I seem to have (until now...). This piece of work is definitely worth an additional globe (not only 5). Even if I knew somebody who had done that before, I am quite sure he won't simply share it. Very kind ;)..... Seize the Day and keep on going , Andy
(If this comment was disrespectful, please report it.)

 
1/16/2003 12:29:09 PM

I read from your answers to the people comments that you have no problem to use it in commercia app. thanks. one more thing I wonder if you can do the treeview to be display in right to left position! it will help a lot. thanx again
(If this comment was disrespectful, please report it.)

 
1/17/2003 9:16:09 AM

Man, the world needs more controls like this! Keep up the good work!
(If this comment was disrespectful, please report it.)

 
1/23/2003 8:01:54 PM

Men! you blew ma mind away, I've been cooking treeview for days now, your code will get my stuff done in minutes. GOD IN HEAVEN WHO IS THE BEST PROGRAMMER EVER WILL BLESS YOU.
(If this comment was disrespectful, please report it.)

 
2/19/2003 5:35:45 PM

Here is the solution to Left$. Put VBA. infront of it. VBA.Left$. That will solve the conflict with this DLL.
(If this comment was disrespectful, please report it.)

 
2/27/2003 4:55:09 AM

Real nice piece of code. I was using version 1 for some time, but this is much better. I added some code for showing or not showing checkboxes. If you're interested please mail.
Also I had the same problem with Left. I found it better to change the enum to Kleft than to change all the rest of my code.
(If this comment was disrespectful, please report it.)

 
3/31/2003 4:37:07 PM

When using a pointer icon to show dragging: the icon needs an offset coordinate like x,y of -3, -15 so the point of the pointer is accurate.
(If this comment was disrespectful, please report it.)

 
3/31/2003 4:47:58 PM

I'd like to drag the node text as well as the node icon. And over lay the NoDrag Icon onto the text when appropriate.
(If this comment was disrespectful, please report it.)

 
3/31/2003 5:01:45 PM

On a node with children move I was updating my db behind the TreeView with a single sql statement then reloading the entire treeview because the nested node move was just too complex. Your .nodemove mothod looks like I can save some bandwidth and lagtime. Thanks
(If this comment was disrespectful, please report it.)

 
4/16/2003 6:43:20 AM

Hi Slider,
Thanks, you did a very good job and it was very helpful to my project. Only the ExpandAll function doesn't seem to work quit well / is very slow with big trees. I've build some checks in my program and it seemed as if this method was again and again expanding from the root node. A complete test tree needed only 500 expands, but the ExpandAll method took more then 100.000 expands.
I wrote a recursive procedure which did only the necessary expands which was a lot faster (something like 15 seconds for 500 expands).
Still with big trees my procedure was very slow too. Do you have any suggestions how I can make an ExpandAll faster? By the way: I use ADO to expand the tree, but the queries took only a fraction of the complete time for expanding.
Hope you can say something about this.
Kind regards
(If this comment was disrespectful, please report it.)

 
4/24/2003 6:26:20 PM

Hi Slider,
Any cahnce of you replying to let us know if your still supporting cTreeView?

Its been 5 months since you've posted here.
(If this comment was disrespectful, please report it.)

 
4/24/2003 6:56:00 PM

Oops, sorry about that.
A quick search on google led me here:

http://www.vbcity.com/forums/topic.asp?tid=8878&page=1

(If this comment was disrespectful, please report it.)

 
4/24/2003 7:12:01 PM

Hi all,
Hoping to get some help on compiling to vbTree.dll.
Worked the first few times but now I have some sort of incombatibility.

Compiling: DLL : set class Instancing = 5 - MultiUse
Have done this but still getting:
The xxxx class module was found in the version-compatible component, but not in the project.
I click the break compatibility and OK
then get:
Compile error:
Private object modules cannot be used in puclib object modules as parameters or return types for public procedures, as public data members, or as fields of public user defined types

I'm sure I've missed something here.

Any help from you .dll experts would be greatly appreciated.
(If this comment was disrespectful, please report it.)

 
4/24/2003 7:51:43 PM

Solved!
(The freezing in debug mode was driving me mad. So I had to return to the .Dll)
Started from scratch.
Downloaded v02.03.00
Downloaded v02.03.01
Modified v02.03.01 with TypeOf changes
Copied v02.03.01 cTreeView.cls to v02.03.00
Changed v02.03.00 'Left' and 'Right' to 'Scroll Left' and 'Scroll Right'

Recompiled v02.03.00 - Successfull !!!

(If this comment was disrespectful, please report it.)

 
6/1/2003 1:09:35 AMThushan Fernando

I found a critical bug, with the drag and drop sample, add two command buttons, in one use Save [XML or Binary] and hte other Load [XML or Binary] run the app, move some nodes around and try and save, close and try loading them, looks like it doesnt save it nicely once its been moved around... any fix?
(If this comment was disrespectful, please report it.)

 
6/1/2003 6:40:12 AM

Dear Mr. Slider the great job that you did by submit this code for CTreeeView is really somthing great but could you send me the code that close connection then reload the tree?
Please Mr. Slider it's important and urgent in fact I use many of your code as parts of my graduation project:) if you do not mind and I have only one week to discus this project so please help me otherwise :( I ll not pass this semster. "Please send on my e-mail :salem_ayed@hotmail.com"
with warm regards
(If this comment was disrespectful, please report it.)

 
6/26/2003 4:16:18 PM

You did a great and outstanding job on cTreeView. WOW! you are really talented... Keep up the great work.
(If this comment was disrespectful, please report it.)

 
7/7/2003 8:21:11 PMSlider

Thushan, the problem is solved. I've emailed you the update last month.

For everyone else, I'm working on new features for the next release based on what ppl have wanted to see added.

If you need this fix urgently, then let me know & I'll email it to you ...

Happy coding!
(If this comment was disrespectful, please report it.)

 
11/22/2003 7:44:09 AMNicos Kkafas

Great Control. Thx
(If this comment was disrespectful, please report it.)

 
4/2/2004 2:20:29 PMWebGuy

Hey, has anyone used this control to make full blown apps? I'd be interested in knowing how people use this, as im sure Slider would be too.

AWESOME CODE *****+
(If this comment was disrespectful, please report it.)

 
4/12/2004 4:02:25 AMThushan Fernando

Slider, Thanks i got it, not sure why i havent replied to your email(?) and WebGuy... we use it in HotHTML 3 Professional -> http://hothtml3.wsoftware.biz along with our documentation tool WebHelp...
(If this comment was disrespectful, please report it.)

 
12/20/2004 12:00:08 PMStephen Coleman

Great Code. I can tell you put lots of time into it...
I found a problem with this. When you add a refrence to your dll.
Public Enum eCodeScrollView '## Scroll Treeview
[Home] = 0
[Page Up] = 1
[Up] = 2
[Down] = 3
[Page Down] = 4
[End] = 5
[Left] = 6 *********
[Page Left] = 7
[Line Left] = 8
[Line Right] = 9
[Page Right] = 10
[Right] = 11 *********
End Enum
Because this is a public enum you can't use left or left$ or Right or Right$. I have seen this problem before. Just remeber use _ In all your enums and then you should not conflict with VB's.
(If this comment was disrespectful, please report it.)

 
2/2/2005 10:47:00 AM

I'm impressed!
I wonder if someone took the time to transfer this goldmine piece of code to vb.net. If so, where can I find the code.
Again, thanks for the beautiful code
Ehud
(If this comment was disrespectful, please report it.)

 
6/11/2005 4:27:07 PMe-roq

Hello... I am interested in adding checkbox support. There was a post on 2/27/2003 4:55:09 AM about added support for this but there is no name to the post. :(
(If this comment was disrespectful, please report it.)

 
9/26/2006 1:08:15 PMShadoW

Double memory buffering should be implemented for the background effect to effectively work on most computers
(If this comment was disrespectful, please report it.)

 
12/6/2006 8:59:17 PMPaul Turcksin

You brag about unique features, but this complete submission is unique! A truly impressive wrapper. I particularly appreciate the tutorials and comprehensive Help. It is a nice break from the "I made this in five miniutes. Please vote me" posts. You definitly deserve our greatest appreciation!
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular article, please click here instead.)
 

To post feedback, first please login.