TreeViewPlus

derez

Expert
Licensed User
Longtime User
When developing the Family-tree application I had to fight with the absence of identifiers on top of the node text, and ended up finally with two trees in parallel, one for the names and the other, invisible, for the ID numbers.

The inability to color the nodes was another limitation.

I saw others look for solutions to other problems, like finding the path from the root node.

I am glad to contribute TreeViewPlus, (based on ControlsEx), providing the abovementioned additions and more.

The attachement includes the library, cs file for integration with the compiled application, help file and an example program. The help file text for the non-changed methods and properties is taken from the original help file of ControlEx.

The additional methods are:
- BackColor and ForeColor for nodes.
- ClearBackColor and ClearForeColor – clear all the nodes colors.
- Tag (as string) – additional identifier to the node.
- SelectedTag – returns the Tag of the selected node.
- AddNewNode2 – define a new node with both Text and Tag.
- FindByTag – searches the tree by the Tag and changes the BackColor of the compatible node, to a color defined by FoundTagColor.
- FindByText1 – searches the tree and returns a string with all the tags of the compatible nodes.
- FindByText2 – searches the tree and paints all the compatible nodes.
- SelectByTag – searches by the Tag and selects the found node.
- TextPath – returns the path from the root node to the activating node, by the Text of the nodes.
- TagPath – returns the path from the root node to the activating node, by the Tags of the nodes.
- FontSize - to set or get the fontsize.
- SetFontStyle - to set the style (bold,underline,italic or strikethrough)


Looking forward for comments and ideas for more improvements.

Edit: updated to ver 1.1 - "FindBy..." and "SearchByTag" methods now include check for empty input strings. FindByText2 and FindByTag now return the number of found nodes.
 

Attachments

  • treeplus.jpg
    treeplus.jpg
    64.9 KB · Views: 150
  • TreeViewPlus_1.1.zip
    39.4 KB · Views: 148
Last edited:

Byak@

Active Member
Licensed User
nice lib,Thanks
 

derez

Expert
Licensed User
Longtime User
Thanks to Racingdog and Agraham who found and commented, I corrected and updated the library to ver 1.1 -

"FindBy..." and "SearchByTag" methods now include check for empty input strings. FindByText2 and FindByTag now return the number of found nodes.
 
Top