"The code is exactly
how I would like to write code and the algorithms used are very
efficient and well-documented."
Van T. Dinh, Microsoft MVP
|
|
Module: modTreeView
Loading the TreeView Windows Common control with data and searching. The TreeView control is one of the components in the comctl32.ocx common controls custom control. It presents an expandable/collapsible hierarchical view of data.
The routines in this module are used to load the treeivew from arrays and recordsets, find strings, and collapse and expand the nodes of the treeview.
|
Procedure Name
|
Type
|
Description
|
|
(Declarations)
|
Declarations
|
Declarations and private variables for the modTreeView module
|
|
ArrayToTreeView
|
Procedure
|
Loads a treeview control with the contents of a string array
|
|
CollapseAllTreeViewNodes
|
Procedure
|
Collapses all the nodes on a treeview control
|
|
CopyTreeView
|
Procedure
|
Copies the contents of one treeview control to another, maintaining the key, tag, image, and relationship information.
Limitations:
1. In order for the parent/child node information to be recreated correctly on the Target treeview control, both the Source and the Target treeview
control should be set to the same setting for the "Sorted" property. Preferably both treeviews will have the Sorted property set to False.
2. In order to recreate the images correctly, you must manually associate both treeview controls with the same ImageList control.
|
|
ExpandAllTreeViewNodes
|
Procedure
|
Expands all the nodes on a treeview control
|
|
FindTagTreeView
|
Procedure
|
Finds a node in the treeview control which contains the search text in the Tag property.
To test whether a node was found, compare the return value of the function to Nothing.
|
|
FindTextTreeView
|
Procedure
|
Finds a node in the treeview control which contains the search text
To test whether a node was found, compare the return value of the function to Nothing.
|
|
GetNodeLevel
|
Procedure
|
Returns a number indicating how many levels deep the node is on the TreeView
|
|
RecordSetToTreeViewADO
|
Procedure
|
Displays the contents of an ADO recordset in a standard unbound TreeView control.
This procedure loads an existing recordset into a treeview control, using the specified column names for the treeview nodes' Text, Key, and Tag properties.
The optional nodParent argument can be used to specify the starting point for the items.
|
|
RecordSetToTreeViewDAO
|
Procedure
|
Displays the contents of a DAO recordset in a standard unbound TreeView control.
This procedure loads an existing recordset into a treeview control, using the specified column names for the treeview nodes' Text, Key, and Tag properties.
The optional nodParent argument can be used to specify the starting point for the items.
|
|
TabularRecordsetToTreeViewADO
|
Procedure
|
Displays the contents of a tabular (hierarchical) ADO recordset in a standard unbound TreeView control
You specify which column in the recordset contains the data to be used at the first level of the nodes (i.e. the "group by" field)
and the column to be used for the detail data within that group. You may optionally specify column names containing the Key information
for the group by and detail nodes, and the Tag information.
Note: This procedure does not sort the records in the recordset. Normally the data should be ordered with the column specified as the 'group by' column with the highest-level sort.
|
|
TabularRecordsetToTreeViewDAO
|
Procedure
|
Displays the contents of a tabular recordset in a standard unbound TreeView control.
You specify which column in the recordset contains the data to be used at the first level of the nodes (i.e. the "group by" field)
and the column to be used for the detail data within that group. You may optionally specify column names containing the Key information
for the group by and detail nodes, and the Tag information.
Note: This procedure does not sort the records in the recordset. Normally the data should be ordered with the column specified as the 'group by' column with the highest-level sort.
|
Overview of Total Visual SourceBook
The source code in Total Visual
SourceBook includes modules and classes for Microsoft Access, Visual
Basic 6 (VB6), and Visual Basic for Applications (VBA) developers. Easily
add this professionally written, tested, and documented royalty-free code
into your applications to simplify your application development efforts.
Additional Resources
|
|