Results 1 to 26 of 26

Thread: Pure VB6 TreeView Control

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Apr 2012
    Posts
    1,253

    Pure VB6 TreeView Control

    ....or ListView if you set the 'Indentation' Property to zero.... ;-)


    Why I created this:
    I am developing a treeview control BUT this isn't it!

    At this stage, I am just creating the classes that will provide the 'engine' for my final work. However, in the course of doing so, I knocked up a very basic VB6 User Control and a hosting form in order to test them. I do not intend to use this Control myself (I'll be writing a new one that draws the nodes and provides for 'proper' hit-tests etc) so may not develop it further unless I need to add functionality to the classes that I need to test. Therefore there may or may not be updates to this post. However, somebody might find it useful to learn from in its current state...

    I'd also appreciate peer code review as I'm a self-taught coder and may be doing some things less efficiently than I could be (or making other glaring mistakes)!

    FEATURES:
    • full keyboard support

    • Drag-And-Drop between nodes

    • User-definable node caption colours

    • User-definable Background colour or picture


    WATCH OUT FOR:
    • Barely any error handlers added as yet (cos I want to expose all errors during testing)

    • Not extensively commented (since I'm re-writing, re-designing as I go along)


    Please do not report errors/crashes with the demo form - it is just a demo. I am however interested in errors raised by the classes and, to a lesser extent, the User Control. I'll repeat; it's really the classes that I am submitting - the rest is just a way of demonstrating/testing them...

    Tree.zip
    If you don't know where you're going, any road will take you there...

    My VB6 love-children: Vee-Hive and Vee-Launcher

  2. #2

    Thread Starter
    Frenzied Member
    Join Date
    Apr 2012
    Posts
    1,253

    Re: Pure VB6 TreeView Control

    I don't know if anybody is interested (since nobody has posted here), but recently I resumed work on my Tree control, making some fairly significant changes in the following areas:

    - GRAPHICS
    Everything is 100% flicker-free and now drawn in 32bit graphics (i.e. an alpha channel is supported). This has been achieved via a reference to vbrichclient4.dll, which is all I use these days when I want nice images and controls (knocks spots off GDI IMHO). As a result, the tree icons are no longer constrained to what can be achieved via the intrinsic VB ImageList control so they, too, can look as nice as you like.

    - DESIGN
    I've introduced the concept of Node types to the tree's design. This means that, when populating a tree, you first define the node types and then start adding nodes of a type; i.e. .Nodes.Add ParentKey, Key, Caption, Type

    The advantage of this is that when defining a Node Type, you can specify some rules for that type such as whether it is a valid drop target, a valid drag source, and whether these are valid for internal (i.e. Node to node drag/dropping), external (i.e. from other controls) or both. Hope that makes sense. It basically means that you don't have to code as many drag/drop rules when using the control.

    Besides this, there are a few new properties added to the test harness (i.e. the form) that you can play with.

    Shout here if you want to see an update in this thread but be aware that you will need to get hold of vbrichclient4.dll as it now has this dependency.
    If you don't know where you're going, any road will take you there...

    My VB6 love-children: Vee-Hive and Vee-Launcher

  3. #3
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    8,598

    Re: Pure VB6 TreeView Control

    You really put a lot of effort into this. I am really impressed. The animation effect is especially appealing. I wish I ran into this when I was still using VB6. I'd have definitely had uses for it.

    Top quality work man....Good job!
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  4. #4

    Thread Starter
    Frenzied Member
    Join Date
    Apr 2012
    Posts
    1,253

    Re: Pure VB6 TreeView Control

    Thanks Niya - that is very pleasing to hear. This control is now waaaaay better than the OP and will improve even more, I'm sure (loving Cairo drawing provided by vbrichclient4). But the fact that you took the time to comment even though my work is of no use to you is even more pleasing and I'm gonna bump your rep purely because of that communal spirit :-)



    EDIT: Meant to mention for the benefit of others:

    Now supports different sort methods per Node Type: 'No Sort', 'Sort by Caption', 'Sort by Type then Caption' (will add others). Control is updated automatically when properties are changed...
    Last edited by ColinE66; Mar 21st, 2013 at 01:17 AM.
    If you don't know where you're going, any road will take you there...

    My VB6 love-children: Vee-Hive and Vee-Launcher

  5. #5
    "Digital Revolution"
    Join Date
    Mar 2005
    Posts
    4,471

    Re: Pure VB6 TreeView Control

    Great jerb! Definitely quality code. Hope you make some more UserControls and submit them here.

  6. #6
    Lively Member
    Join Date
    Jun 2010
    Posts
    68

    Re: Pure VB6 TreeView Control

    good work bro,if you add unicode support in tree node then it will be more helpful,God bless you
    reply on various posts make you a power poster,may not being u a helpful poster,if u dn't understand how u help then dn't need to reply,it increases ur post count,but decreases ur worthness

  7. #7

    Thread Starter
    Frenzied Member
    Join Date
    Apr 2012
    Posts
    1,253

    Re: Pure VB6 TreeView Control

    The latest version does support unicode - but not the one in Post #1
    If you don't know where you're going, any road will take you there...

    My VB6 love-children: Vee-Hive and Vee-Launcher

  8. #8
    Junior Member
    Join Date
    Mar 2006
    Posts
    19

    Re: Pure VB6 TreeView Control

    No checkboxes?

  9. #9

    Thread Starter
    Frenzied Member
    Join Date
    Apr 2012
    Posts
    1,253

    Re: Pure VB6 TreeView Control

    What, in a demo? Did you actually read the first post?
    If you don't know where you're going, any road will take you there...

    My VB6 love-children: Vee-Hive and Vee-Launcher

  10. #10
    Junior Member
    Join Date
    Mar 2006
    Posts
    19

    Re: Pure VB6 TreeView Control

    Quote Originally Posted by ColinE66 View Post
    What, in a demo? Did you actually read the first post?
    Yes I did and thank you for turning me on to Olaf's (http://www.vbrichclient.com/#/en/About/) work.

    I was just trying to find out if there was a property lurking somewhere that would enable checkboxes that I may have missed.

    Thanks

  11. #11

    Thread Starter
    Frenzied Member
    Join Date
    Apr 2012
    Posts
    1,253

    Re: Pure VB6 TreeView Control

    No, there is no property. In my demo you could add checkbox controls to achieve that effect but, since you are more interested in the Cairo stuff, the answer is that you would need to create them yourself, as Cairo widgets...
    If you don't know where you're going, any road will take you there...

    My VB6 love-children: Vee-Hive and Vee-Launcher

  12. #12
    New Member
    Join Date
    Dec 2015
    Posts
    4

    Re: Pure VB6 TreeView Control

    Hello,

    I understand it is too late, but is the treeview control with unicode support available for download?
    Please advise.
    Thanks.

  13. #13
    Addicted Member
    Join Date
    May 2016
    Location
    China
    Posts
    197

    Re: Pure VB6 TreeView Control

    Why don't you support the mouse scrolling

  14. #14
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    5,872

    Re: Pure VB6 TreeView Control

    It's a demo, not a full blown control...
    And the source code is available, so you can enhance it like you want.

  15. #15
    New Member
    Join Date
    Dec 2015
    Posts
    4

    Re: Pure VB6 TreeView Control

    Quote Originally Posted by Arnoutdv View Post
    It's a demo, not a full blown control...
    And the source code is available, so you can enhance it like you want.
    Thanks for the reply.
    I understand its a demo. In the source code, replacing intrinsic label control with UniLabel, we get the unicode support.

    Since the author has mentioned that the unicode support is added, I preferred to check his implementation.

  16. #16
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    5,872

    Re: Pure VB6 TreeView Control

    No problem, my reply was targeted at ChenLin ...

  17. #17
    Lively Member
    Join Date
    Sep 2016
    Posts
    94

    Re: Pure VB6 TreeView Control

    Great !
    Congratulations.
    Please go on in that way to implement checkbox, multiselect, and others...
    Regards

  18. #18
    Frenzied Member
    Join Date
    Dec 2008
    Location
    Melbourne Australia
    Posts
    1,487

    Re: Pure VB6 TreeView Control

    Quote Originally Posted by ColinE66 View Post
    The latest version does support unicode - but not the one in Post #1
    Is there a 'later version' download link on this page, that I cannot see ?
    Or is the download in post 1, the latest ?

    Thanks,
    Rob

  19. #19

    Thread Starter
    Frenzied Member
    Join Date
    Apr 2012
    Posts
    1,253

    Re: Pure VB6 TreeView Control

    Hi bobbles,

    The only version that has been maintained has a dependency on Olaf's RC5. If you are interested in that, I can submit it in a new Code Bank thread.
    If you don't know where you're going, any road will take you there...

    My VB6 love-children: Vee-Hive and Vee-Launcher

  20. #20
    Frenzied Member
    Join Date
    Dec 2008
    Location
    Melbourne Australia
    Posts
    1,487

    Re: Pure VB6 TreeView Control

    Quote Originally Posted by ColinE66 View Post
    Hi bobbles,

    The only version that has been maintained has a dependency on Olaf's RC5. If you are interested in that, I can submit it in a new Code Bank thread.
    Colin,
    I do all my VB6 development in my XP PC.
    I believe I recall that Olaf's contributions usually need Vista or more recent.
    If my memory is correct (won't work in XP) then don't go to that trouble for me.

    Thanks for the offer though,
    Rob

  21. #21
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,121

    Re: Pure VB6 TreeView Control

    @Colin: Can you please upload it for the rest of us that believe most of RC5 works on XP and the parts that don't are obscure enough to not care that much about. . .

    cheers,
    </wqw>

  22. #22

    Thread Starter
    Frenzied Member
    Join Date
    Apr 2012
    Posts
    1,253

    Re: Pure VB6 TreeView Control

    OK. I've been a bit lazy with it recently in terms of the way it's integrated into my main app so I'll need a little time to de-couple it back into something more stand-alone. Gimme a few days...
    If you don't know where you're going, any road will take you there...

    My VB6 love-children: Vee-Hive and Vee-Launcher

  23. #23
    PowerPoster
    Join Date
    Sep 2012
    Posts
    2,083

    Re: Pure VB6 TreeView Control

    Quote Originally Posted by Bobbles View Post
    Colin,
    I do all my VB6 development in my XP PC.
    I believe I recall that Olaf's contributions usually need Vista or more recent.
    If my memory is correct (won't work in XP) then don't go to that trouble for me.

    Thanks for the offer though,
    Rob
    Hi Bobbles, all my VB6 development is also in XP PC, and all my software runs on XP, Vista, Win7, Win8 and Win10. If you don't use CoreAudio, RC5 works without any problems on XP. The compatibility of RC5 is excellent.
    Last edited by dreammanor; May 15th, 2018 at 09:50 AM.

  24. #24

    Thread Starter
    Frenzied Member
    Join Date
    Apr 2012
    Posts
    1,253

    Re: Pure VB6 TreeView Control

    If you don't know where you're going, any road will take you there...

    My VB6 love-children: Vee-Hive and Vee-Launcher

  25. #25
    Member
    Join Date
    Oct 2018
    Posts
    59

    Re: Pure VB6 TreeView Control

    Great job, but it looks like it doesn't have the checkbox property.

  26. #26
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    5,872

    Re: Pure VB6 TreeView Control

    If you had read the rest of the thread you would have seen that checkboxes are not implemented.

    The latest version can be found here:
    https://www.vbforums.com/showthread....t-RAD-TreeView

    And I believe it doesn't have checkboxes either.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width