Quick Search for:  in language:    
ADO,Release,cTREEVIEW,features,Flat,border,Is
   Code/Articles » |  Newest/Best » |  Community » |  Jobs » |  Other » |  Goto » | 
CategoriesSearch Newest CodeCoding ContestCode of the DayAsk A ProJobsUpload
Visual Basic Stats

 Code: 3,014,970. lines
 Jobs: 119. postings

 How to support the site

 
Sponsored by:

 

You are in:

 
Login



Latest Code Ticker for Visual Basic.
Unroll2 - Update
By Cyber Chris on 7/2


MultilinePWD
By Cyber Chris on 7/2


Click here to see a screenshot of this code!Song/Poem Assistant
By Peter Rowan on 7/2

(Screen Shot)

Click here to see a screenshot of this code!GPA Cal
By KBM-00 on 7/2

(Screen Shot)

Click here to see a screenshot of this code!Connection Via the Telephone line.No internet or cable.Just the telephone line
By Nass ClickMan on 7/2

(Screen Shot)

DBTool
By Make Strömberg on 7/2


Click here to see a screenshot of this code!MSChart Simple Example
By Sebastian Pereira on 7/2

(Screen Shot)

CString v1.5
By Ultimatum on 7/2


Tablature Pro
By Michael McMullen on 7/2


Click here to put this ticker on your site!


Add this ticker to your desktop!


Daily Code Email
To join the 'Code of the Day' Mailing List click here!





Affiliate Sites



 
 
   

cTREEVIEW Class Wrapper (RELEASE 3) with ADO Code Example

Print
Email
 
winzip icon
Submitted on: 9/20/2001 4:52:08 AM
By: Slider 
Level: Intermediate
User Rating: By 66 Users
Compatibility:VB 6.0

Users have accessed this code 16352 times.
 
 
     ** Release 3 ** New cTREEVIEW features: Flat border; IsChildNode; CopyNode with cancel option; Cut Icon state. ADO example supporting: Load on demand; Find First/ Next/ Previous; Label Edit; Drag'n'Drop; Node & TreeView context menus; node specific Open/Closed/Drag icons. ADO Example now supports: New Nodes/Records can be added; copy treeview node(s); Cut/Copy/Paste through right-click context menu; and functions are now benchmarked with results displayed. ** Release 2 ** cTREEVIEW class features: Scroll treeview Up/ Down/ PageUp/ PageDown/ Home/ End using code; Dragging with auto-scrolling (not supported by Microsoft in the TreeView control); NodeFirstViewable; & NodeLastViewable. ADO Example fixes: Find Next/Previous didn't work if branches already loaded. cTREEVIEW class fixes: correct node drag icon displayed. cTreeview features include: fast clear a treeview; extended Add/Rename/Delete nodes; copy & move nodes through code &/or Drag'n'Drop including parent nodes onto child nodes (not normally possible!); find node using text and (optionally) key properties; check if a node is a parent of another; checks if a node is a root node; a safe get parent node text; right-click context menu (before/after click event); collapse/expand all nodes; collape/expand all child nodes; enable/disable redraw. This example shows how to:- work with multiple tables of data and load data on demand. As a bonus, I've included cDB class that encapsulates working with an Access Database using ADO. All code is heavily commented. If there are any routines that you feel are missing or code/bug-fixes that you wish to contribute, then please let me know and I'll add them in. *** Latest version can be found here:- http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=37553&lngWId;=1 ***

 
winzip iconDownload code

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 Winzipto 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 code, you agree to the following terms...   
1) You may use this code 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 code (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 code 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 code or code's description.


Other 17 submission(s) by this author

 

 
Report Bad Submission
Use this form to notify us if this entry should be deleted (i.e contains no code, is a virus, etc.).
Reason:
 
Your Vote!

What do you think of this code(in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor See Voting Log
 
Other User Comments
9/20/2001 6:45:54 AM:Lawman
Mate - this just blew my socks off! 
Keep up the fantastic work! 5 Globes 
from me!!!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
9/20/2001 10:57:56 AM:aaron
very nice :D 5 globes for great work
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
9/20/2001 5:04:22 PM:Reggie
Hey slider this is a really great thing 
you got going on here. I just 
downloaded the previous version about a 
week ago and thought it was the 
greatest thing since slice bread and 
then saw this one and thought... he's 
good. Keep up the good work. This has 
helped me out alot. 
One request for 
your next version. Could you put to use 
a pop up menu only inside of treeview 
window. Thanks!!!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
9/20/2001 5:55:04 PM:Slider
Lawman, Aaron, reggie thanks for the 
votes!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
9/20/2001 6:02:03 PM:Slider
Reggie, the ContextMenu event is where 
you put your code for the popup menu. 
The ContextMenu event was also designed 
to tell you which note was 
right-clicked. I guess that I was lazy 
and didn't put it into the example. 
I'll add it and icons to the example.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
9/20/2001 6:21:05 PM:Hot Head
Hey reggie, I agree with you. I've 
always struggled with the Treeview 
control and found it hard to do much 
with it. I'm now going to use this 
class with the control in all of my 
applications. Thanks Slider & keep up 
coding man! I can't wait to see what's 
coming next....
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
9/20/2001 11:21:57 PM:Zhu JinYong
Excellant!I have downloaded all program 
of your submissions.I saw much 
improvements you have made.
Suggention:could you add image for 
every node? and,May it be better to 
support Right Click and pop up a menu 
to set up all properties of this 
control.
  Thank for your great job!
 Email:zhujy@samling.com.my
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
9/21/2001 2:08:46 AM:Slider
Zhu,
Thanks for your support. (Icon) 
Image support is already there standard 
with the control. As I've implemented 
right click event called 
ContextMenu(Node, X, Y,) - it will 
advise which node was right clicked. 
What I'm doing is updating the example 
to include right click popup menus 
(Node vs control) + icons (Expanded, 
collapsed, drag, etc...), cTreeView 
class to support background image. 
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
9/21/2001 3:54:22 AM:Zhu JinYong
Thanks for so fast reply.For your 
information,there are some bugs when 
moving Node.Pls correct it.
You,always do good job.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
9/21/2001 8:34:00 AM:slider
Zhu, more info pls
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
9/22/2001 5:11:35 AM:michael
Hello Slider,
>
what can I say, a 
fantastic work.
5 stars from 
me.
>
regards
michael doering
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
9/26/2001 3:11:11 AM:Hari
Boy! this is wonderful. I am actually 
working on something like this and 
found your code and this makes it 
easier. Keep up the good work. Defn 5 
globes
:-)
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
9/29/2001 12:03:14 AM:Hans
Great work! 5 stars from me!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
10/14/2001 2:47:21 PM:Thanawut Naonan
This is the GREATTEST work I've ever 
seen on PSC!!!!!
5 BIG GLOBES FOR 
YOU!!!
Keep up your good 
work!!
:-)
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
11/26/2001 3:00:13 PM:Carp@verdictsystems.com
Slider - 
This is a very 
comprehensive treeview helper!
Two 
questions for you -
One - if the 
tree contains a very large number of 
nodes (say you're loading from a 
database), then using the Key property 
when you add nodes slows it down 
incredibly. I've been trying to find a 
solution for this forever, and I know 
it can be done since various third 
party controls provide database binding 
to a tree that loads very 
quickly.
Second - I've posted this 
to a few user groups with no luck - is 
it possible to create a "mask" for the 
icon to change depending on some 
external condition other than whether 
the item was selected/de-selected. For 
example if the tree is created from a 
database and you want the icon to 
change based on a certain entry, rather 
than creating a separate icon for the 
node, is is possible to just add an 
overlay (kind of like a windows 
shortcut curvey arrow) to the existing 
icon?
Great code!
Carp
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
12/3/2001 11:23:03 AM:Bruce
GREAT CODE!
When running your demo, 
I'm having trouble moving a node within 
the control by dragging it.  It appears 
that the Dragging and Dropped events of 
the control are never fired.  Any ideas 
on how to fix this?
Thanks in advance!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
12/3/2001 11:02:33 PM:Slider (Author)
Bruce,
I'm not experiencing your 
problem. Do you have VB Service Pack 5 
installed?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
1/14/2002 7:41:13 AM:Coite
Well already voted on the original, so 
will have to give you another 5 Globes 
in comment format. Real glad to see you 
are improving this, nice work, nice 
code, and Thanks!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
1/14/2002 8:50:49 AM:Daniel
Great stuff! Thanks!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
1/14/2002 9:52:08 AM:John Couture
Great code.  Well written and 
commented.  It's nice to see real 
professional code.  This example will 
definitely make me check out your other 
submissions.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
1/14/2002 8:41:06 PM:alfonso
This is a great code you deserve 5 
globes from me Keep the good work
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
1/16/2002 12:48:06 AM:Zhu JinYong
Hi Slider,Still remember the minor bugs 
when fast double clicking node to 
expand or collapse,error "Unable to 
move selected node" occurs.Just put 
"Sleep 100" after---If Not (.HitTest(X, 
Y) Is Nothing) Then---in 
oTree_MouseMove routine to force the 
program stop 100ms.Maybe have a better 
way to do.
Email to 
:zhujy@samling.com.my
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
1/16/2002 6:10:50 AM:Slider
Zhu, Thanks for the suggestion. A new 
version will be posted shortly and I'll 
have a work-around included.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
1/17/2002 12:34:25 AM:Imran Iqbal
This type of work is appreciatable.You 
have done very good.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
1/17/2002 6:19:28 AM:enjoy
This is one of the Great Work I've Seen 
in PSC!!!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
1/17/2002 8:47:38 PM:Zhu JinYong
Add a Timer(ccrpTimer)to auto expand 
Parent Nodes while dragging node to 
drop to another Node.I think you can do 
it or contact me:zhujy@samling.com.my
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
3/22/2002 4:07:52 PM:DougW
This absolutely saved me at LEAST a 
month of busting my brain. Very 
Comprehensive work! Excellent examples! 
Thanks!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/4/2002 7:09:36 PM:Slider
new version (v02.01.00) can be found at 
<http://www.planetsourcecode.com/vb/scri
pts/ShowCode.asp?txtCodeId=34439&lngWId=
1>
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/27/2002 11:29:08 PM:Dane
Slider, this is awesome. 5 Globes. I 
have 2 points: When the Node is 
expanded the Icon is not correct until 
a SubNode is selected.
When in Drag 
Mode - Pressing 'Esc' (27) should end 
the drag action. Again Great Code.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
6/7/2002 10:03:48 AM:Rob
Excellent Code, extremely well written, 
v. v. good
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
6/20/2002 5:37:44 AM:Michel
Nice program I use it partially in my 
remake of regEdit tools.
So I think 
that I have identify a trouble into the 
utilization of collapseAll Sub.
I you 
use CollapseAll sub After the standard 
collapse expand by clicking on the + or 
- doesn't work!
To test that add a 
command button to your Form and  
CollapseAll into the command_click 
Sub.
Ready to do more tests.
One 
more time thanks you
Michel
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/19/2002 5:10:33 PM:Mike
Not bad man, now if you could just 
encompass all of that functionality 
into one control you would have the 
best treeview control.
-Mike
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/19/2002 11:35:41 PM:Slider
Dane, Thanks for the comments, will 
look into it. Rob, thanks for the 
feedback! Michael, code fixed & will be 
release within the next few days (code 
sent via email already). Mike, Thanks 
for the feedback - it's already in the 
planning stages.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
8/1/2002 1:39:24 PM:Andrew
can you add functionality to save and 
load a treeview into/from a file?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
8/1/2002 11:02:56 PM:Slider
Andrew,
Already done back in April. 
To get the latest version goto:- 
http://www.planetsourcecode.com/vb/scrip
ts/ShowCode.asp?txtCodeId=34439&lngWId=1
I'm currently trying to upload 
release 5 but having great difficulty 
with the site timing out - keep your 
eyes peeled - it'll be up any sec 
now....
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
8/4/2002 2:25:16 AM:Slider
** *** Latest version can be found 
here:- 
http://www.planetsourcecode.com/vb/scrip
ts/ShowCode.asp?txtCodeId=37553&lngWId=1
 *** **
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
10/26/2002 3:26:16 AM:Amer Khreim
can you help me Slider  
i need your 
help please
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
10/29/2002 5:37:17 AM:Slider
How can I help?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
11/11/2002 4:45:31 AM:
Thanks heaps Slider. Have another five 
globes!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
2/17/2003 4:25:00 PM:JaySonic
Great code slider. Can you suggest a 
good way to keep track of the order of 
the nodes? If you move products around 
within the same group, they will just 
re-arrange back when you reload. Seems 
the order in which they were added is 
as far as it goes. Any insight to this?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
2/18/2003 6:41:46 AM:Slider
JaySonic, You've found an old version 
of cTreeView. I'd suggest grabbing the 
latest and you the Load/Save and 
that'll fix your problem!
Slider
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
2/18/2003 10:34:56 AM:JaySonic
Thanks for reply Slider. I have 
downloaded the version 2.03 and tried 
it with no success. What I was refering 
to was in regards of the ADO refrence 
to the treeview. By reload, I meant 
closing the application and starting 
back up again. I figure I must need to 
apply and orderID number to each 
product within a group, and then update 
ID when it moves areound in the group. 
It is the only way I can see of keeping 
the oder of the nodes. Does that make 
sense or have I totaly lost myself?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
2/18/2003 11:32:34 AM:JaySonic
One other thing I have noticed Slider, 
is that the Left and Right VB functions 
no longer work once a refrence to the 
cTreeView Wrapper Class is 
made......Further investigation into 
the problem using the NODLL vbp has 
revealed the source of the problem is 
in the cTreeView.cls file.
I hope 
you dont think I am being picky. This 
is still one of the best submissions I 
have seen!!!
Thanks
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
2/18/2003 11:59:18 AM:JaySonic
The problem in not being able to use 
the Right and Left functions has to due 
with the declarations in the 
cTreeView.cls file at the
Public Enum 
eCodeScrollView
location. Abbreviating 
the [Left] and [Right] to something 
like [LT] and [RT], then replacing 
those instances througout the code will 
solve the problem. Sorry for all the 
posts, just trying to add value.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
2/18/2003 3:07:35 PM:JaySonic
Pardon me Slider, I found where you are 
able to load and save. Thanks
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
2/18/2003 6:03:47 PM:JaySonic
Hey Slider, I am trying to debug the 
save/load ability because it doesnt 
seem to be saving/loading the order 
correctly. Anyway, I am fairly new to 
programming dll's and was wonder if you 
could enlighten me on you debug the 
classes. Every time I try to do it my 
computer locks the application up at 
the break. Any insight on this would be 
very helpful!
Thanks
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
3/3/2003 9:56:02 AM:JaySonic
Thanks anyway
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/28/2003 9:46:10 PM:
2 words......... holy sh%$
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
Add Your Feedback!
Note:Not only will your feedback be posted, but an email will be sent to the code's author in your name.

NOTICE: The author of this code has been kind enough to share it with you.  If you have a criticism, please state it politely or it will be deleted.

For feedback not related to this particular code, please click here.
 
Name:
Comment:

 

Categories | Articles and Tutorials | Advanced Search | Recommended Reading | Upload | Newest Code | Code of the Month | Code of the Day | All Time Hall of Fame | Coding Contest | Search for a job | Post a Job | Ask a Pro Discussion Forum | Live Chat | Feedback | Customize | Visual Basic Home | Site Home | Other Sites | About the Site | Feedback | Link to the Site | Awards | Advertising | Privacy

Copyright© 1997 by Exhedra Solutions, Inc. All Rights Reserved.  By using this site you agree to its Terms and Conditions.  Planet Source Code (tm) and the phrase "Dream It. Code It" (tm) are trademarks of Exhedra Solutions, Inc.