Results 1 to 4 of 4

Thread: [RESOLVED] How to get +/- on TreeView Root node?

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Resolved [RESOLVED] How to get +/- on TreeView Root node?

    This should be pretty simple but the "formula" is escaping me right now.


    I'm using a plain old VB6 TreeView control from MSCOMCTL.OCX and I have loaded a small tree of nodes. I have the Style property set to 6 (tvwTreelinesPlusMinusText). After I load the TreeView control's node hierarchy, I leave everything unexpanded.

    What I want is an indication that there are nodes present (to be expanded) under the Root of the tree, but I don't get a +/- box to the left of the Root node. After expanding the Root I do see these for child nodes with children however.


    I know I've seen this in other software. Is this a quirk of the VB6 TreeView control or is there a property setting that will show these?

    Here are screenshots before and after I manually expand the Root node:
    Attached Images Attached Images   

  2. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: How to get +/- on TreeView Root node?

    Not sure if it's a quirk or not. Windows explorer exhibits same behavior on its root node (the Desktop). Maybe add some text to indicate something: Bedrock (4 items) ?

    Maybe the LineStyle property of RootLines is what you are looking for? A little different output.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: How to get +/- on TreeView Root node?

    You hit it: LineStyle = tvwRootLines produced the desired result.

    I was sure I'd tried this but this UI has gone through countless changes (Are we sure the customer is always right?) and maybe it's just Friday.

    Thanks for the assistance!

  4. #4

    Thread Starter
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: How to get +/- on TreeView Root node?

    Wow, this sure gets fun. Now they want to drop the "redundant" top level node.

    No problem, but with the RootLines it looks a bit funky to my eye:
    Attached Images Attached Images  

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