ProtoView TreeViewX Control

The ProtoView TreeViewX control is a hierarchical list box control suitable for displaying lists of items in a hierarchical manner. The TreeViewX control is similar to the Microsoft treeview control; however, the WinX version adds a number of important features, such as multi-column support, easier node traversal, customize pictures, and data binding.

Binding

The TreeViewX control can be bound to a data source and display a single column of data from a flat record source, or a column for each table in a hierarchical data source.  This is done by assigning the DataSource property to an appropriate data control or record source, and then setting the DataField property to a single column in the data source (once per table).  When the TreeViewX control is bound, two events, BeforeDBAddNode and AfterDBAddNode are fired before and after a node is added to the TreeView, respectively.  Developers can use the BeforeDBAddNode event to abort the addition of the node or to customize the text of the branch, and the AfterDBAddNode event to add sub-items to the node.

The following code demonstrates binding to a hierarchical result set with three levels.   Each level of the TreeViewX can display a single column of the corresponding table in the record set.

TreeViewX.DataSource = ADODC1
TreeViewX.DataField(0) = "LastName"
TreeViewX.DataField(1) = "Product"
TreeViewX.DataField(2) = "Quantity"

TreeViewX Properties

List of Properties

The ProtoView TreeViewX control supports the following properties:

AllowInPlaceEditing

AlwaysShowSelection

Appearance*

AutoOpen

BackColor*

BorderStyle*

Branches

ColumnWidth

Count

CustomDefaultPicture

CustomLevelPicture

DataField

DataSource

Enabled*

EnableBitmaps

EnableLines

EnableMicroBitmaps

EnableToolTips

Font*

ForeColor*

HorizontalExtent

hWnd*

Indent

IntegralHeight

LineColor

MultiColumn

MultiColumnStyle

NumberOfColumns

ProportionalScrollBars

Redraw

SelectedTextBackColor

SelectedTextForeColor

SelectMode

Sort

StandardDefaultPicture

StandardLevelPicture

TabPoint

TabPointCount

ToolTipBackColor

UseStateBitmaps

UseTabStops

VisibleCount

* This is a common property described in the Appendix: Common Properties, Methods and Events.

AllowInPlaceEditing

Returns or sets a value that determines whether a TreeViewX control will allow direct modification of a branch's text.

Syntax

Visual Basic

object.AllowInPlaceEditing = boolean
boolean = object.
AllowInPlaceEditing

Visual C++

object.SetAllowInPlaceEditing(boolean);
boolean = object.GetAllowInPlaceEditing( );

Delphi

object.AllowInPlaceEditing := boolean;
boolean := object.AllowInPlaceEditing;

The AllowInPlaceEditing property syntax has these parts:

Part Description
object A TreeViewX object.
boolean A Boolean expression that specifies whether object will allow in-place editing.

Settings

The settings for boolean are:

Setting Description
True Allows direct modification of branch's text.
False Makes all branch object's read-only.

AlwaysShowSelection

Returns or sets the selection display state of a TreeViewX control.

Syntax

Visual Basic

object.AlwaysShowSelection = boolean
boolean = object.AlwaysShowSelection

Visual C++

object.SetAlwaysShowSelection ( boolean );
boolean = object.GetAlwaysShowSelection( );

Delphi

object.AlwaysShowSelection := boolean;
boolean := object.AlwaysShowSelection;

The AlwaysShowSelection property syntax has these parts:

Part Description
object A TreeViewX object.
boolean A Boolean expression that specifies whether the selection state remains constant when the TreeViewX control looses focus.

Settings

The settings for boolean are:

Setting Description
True The selected item(s) in the TreeViewX control are always painted with the highlight background color.
False (Default) The selected item(s) in the TreeViewX control are painted with the highlight background color only when the control has focus.

Remarks

This property should normally be set to False (the default value) to comply with Microsofts’ interface design guidelines for Windows programs.

AutoOpen

Returns or sets the auto open state of the TreeViewX control.

Syntax

Visual Basic

object.AutoOpen = boolean
boolean = object.AutoOpen

Visual C++

object.SetAutoOpen ( boolean );
boolean = object.GetAutoOpen( );

Delphi

object.AutoOpen := boolean;
boolean := object.AutoOpen;

The AutoOpen property syntax has these parts:

Part Description
object A TreeViewX object.
boolean A Boolean expression that specifies whether the parent item will automatically open when a child is added.

Settings

The settings for boolean are:

Setting Description
True Items of the TreeViewX control automatically open the first time a child item is added to the item.
False (Default) Items of the TreeViewX control do not automatically open when child items are added.

Remarks

The AutoOpen property only affects an item when the first child is added to it. This property is ignored for subsequent child items. This property is also ignored if any of the items’ parent items are closed or if the item is locked.

Branches

The Branches property returns the list of items in a TreeViewX control. Read only at run time, not available at design time.

Syntax

Visual Basic

branch = object.Branches

Visual C++

branch = object.GetBranches( );

Delphi

branch := object.Branches;

The object placeholder represents an object expression that evaluates to TreeViewX control.

Part Description
object A TreeViewX object.
branch A branch object.

Remarks

The Branches property returns a Branch Object, through which you can manipulate items in a TreeViewX control.

The Branch object returned by this property is the main Branch. As such it does not correspond to a TreeViewX control item per se, as do all other Branches. However, you can use its methods to gain access to all other items in the TreeViewX control.

ColumnWidth

The ColumnWidth property sets or returns the width of an individual column in the TreeViewX control.

Syntax

Visual Basic

object.ColumnWidth = value
value = object.ColumnWidth

Visual C++

object.SetColumnWidth (value);
value = object.GetColumnWidth( );

Delphi

object.ColumnWidth:= value;
value := object.ColumnWidth;

The ColumnWidth property syntax has these parts:

Part Description
object A TreeViewX object.
value A short integer or constant that determines the column width, in pixels, of an individual column in a multicolumnK TreeViewX control.

Remarks

The ColumnWidth property only affects a multicolumn / fixed column width TreeViewX control. That is to say, the TreeViewX control must have its MultiColumn Property set to True, and its MultiColumnStyle Property set to 0 for this property to have any effect.

Count

The Count property returns the total number of items in a TreeViewX control. Read only at run timeK, not available at design time.

Syntax

Visual Basic

value = object.Count

Visual C++

value = object.GetCount( );

Delphi

value := object.Count;

Part Description
object A TreeViewX object.
value A long integer which contains the number of items in the TreeViewX control.

Remarks

The Count property is a read only variable at run timeK.

CustomDefaultPicture

The CustomDefaultPicture property sets or returns the default picture displayed next to each item on the TreeViewX control.

Syntax

Visual Basic

object.CustomDefaultPicture = picture
picture = object.CustomDefaultPicture

Visual C++

object.SetCustomDefaultPicture (picture);
picture = object.GetCustomDefaultPicture( );

Delphi

object.CustomDefaultPicture:= picture;
picture := object.CustomDefaultPicture;

The CustomDefaultPicture property syntax has these parts:

Part Description
object A TreeViewX object.
picture A picture object which contains a graphic, as described in Settings.

Settings

The settings for picture are:

Setting Description
(None) (Default) No picture.
(Bitmap, icon, metafile) Specifies a graphic. You can load the graphic from the Properties window at design time. At run time, you can also set this property using the LoadPicture function on a bitmap, icon, or metafile.

Remarks

Please see the Remarks for TreeViewX images.

CustomLevelPicture

The CustomLevelPicture property sets or returns the default picture displayed next to each item on the TreeViewX control on a particular level.

Syntax

Visual Basic

object.CustomLevelPicture(level) = picture
picture = object.CustomLevelPicture(level)

Visual C++

object.SetCustomLevelPicture (level, picture);
picture = object.GetCustomLevelPicture(level);

Delphi

object.CustomLevelPicture[level] := picture;
picture := object.CustomLevelPicture[level];

The CustomLevelPicture property syntax has these parts:

Part Description
object A TreeViewX object.
level A short integer that specifies the level for which the default picture is to be set.
picture A picture object which contains a graphic, as described in Settings.

Settings

The settings for picture are:

Setting Description
(None) (Default) No picture.
(Bitmap, icon, metafile) Specifies a graphic. You can load the graphic from the Properties window at design time. At run time, you can also set this property using the LoadPicture function on a bitmap, icon, or metafile.

Remarks

Please see the Remarks for TreeViewX images.

DataField

Returns or sets the column name TreeViewX uses to display values from the data source for each level of the treeview.

Syntax

Visual Basic

object.DataField(level) = value
value = object.
DataField(level)

Visual C++

object.SetDataFielde (level, value);
value = object.GetDataField(level);

Delphi

object.DataField[level] := value;
value := object.DataField[level];

The CustomLevelPicture property syntax has these parts:

Part Description
object A TreeViewX object.
level A long integer specifying the level for the column values to be displayed.
value A string representing a column in the database.

Remarks

TreeViewX is bound to a database by specifying a Data control in the DataSource property at design time using the Properties window or by setting the DataSource property at runtime.  A column in the database is bound to a the TreeViewX by using the DataField property of the TreeViewX.  See the comments on data binding to the TreeView.

Example

The following code demonstrates binding to a hierarchical result set with three levels.   Each level of the TreeViewX can display a single column of the corresponding table in the record set.

TreeViewX.DataSource = ADODC1
TreeViewX.DataField(0) = "LastName"
TreeViewX.DataField(1) = "Product"
TreeViewX.DataField(2) = "Quantity"

DataSource

Sets a value that specifies the Data control through which the TreeViewX is bound to a database.

Remarks

TreeViewX is bound to a database by specifying a Data control in the DataSource property at design time using the Properties window or by setting the DataSource property at runtime.  A column in the database is bound to the TreeViewX by using the DataField property of the TreeViewX.  See the comments on data binding to the TreeView.

EnableBitmaps

Returns or sets a value that determines whether a TreeViewX control will display images next to each item in the control.

Syntax

Visual Basic

object.EnableBitmaps = boolean
boolean = object.
EnableBitmaps

Visual C++

object.SetEnableBitmaps (boolean);
boolean = object.GetEnableBitmaps( );

Delphi

object.EnableBitmap := boolean;
boolean:= object.EnableBitmaps;

The EnableBitmaps property syntax has these parts:

Part Description
object A TreeViewX object.
boolean A Boolean expression that specifies whether object will display images next to each item.

Settings

The settings for boolean are:

Setting Description
True (Default) The TreeViewX will display images next to items.
False The TreeViewX will display no images next to items.

Remarks

The EnableBitmaps property allows the TreeViewX control to display an image next to each item at run time. The item to be displayed depends on a number of other settings.

Please see the Remarks for TreeViewX images.

EnableLines

Returns or sets a value that determines whether a TreeViewX control will display lines connecting parent items to their children.

Syntax

Visual Basic

object.EnableLines = boolean
boolean = object.
EnableLines

Visual C++

object.SetEnableLines(boolean);
boolean = object.GetEnableLines( );

Delphi

object.EnableLines := boolean;
boolean := object.EnableLines;

The EnableLines property syntax has these parts:

Part Description
object A TreeViewX object.
boolean A Boolean expression that specifies whether object will display lines connecting parent items to their children.

Settings

The settings for boolean are:

Setting Description
True (Default) Causes object to display lines connecting parent items to their children.
False Prevents object from displaying lines connecting parent items to their children.

EnableMicroBitmaps

Returns or sets a value that determines whether a TreeViewX control will display a box containing either a "+" or "-" next to each item. A box with a "+" indicates that a closed item has children. Clicking on the "+" with the mouse will cause the item to open (display it’s children in the TreeViewX control). A box with a "-" indicates that the item has children and is open. Clicking on the "-" will cause the item to close.

Syntax

Visual Basic

object.EnableMicroBitmaps = boolean
boolean = object.EnableMicroBitmaps

Visual C++

object.SetEnableMicroBitmaps(boolean);
boolean = object.GetEnableMicroBitmaps( );

Delphi

object.EnableMicroBitmaps := boolean;
boolean := object.EnableMicroBitmaps;

The EnableMicroBitmaps property syntax has these parts:

Part Description
object A TreeViewX object.
boolean A Boolean expression that specifies whether object will display a box containing either a "+" or "-" next to each item.

Settings

The settings for boolean are:

Setting Description
True (Default) Causes object to display a box containing either a "+" or "-" next to each item.
False Prevents object from displaying display a box containing either a "+" or "-" next to each item.

EnableToolTips

Returns or sets a value that determines whether a TreeViewX control will display tool tips when the mouse is over a branch object.  A tool tip displays the entire text of a branch object, even if the branch object is clipped by the TreeViewX control.

Syntax

Visual Basic

object.EnableToolTips = boolean
boolean = object.
EnableToolTips

Visual C++

object.SetEnableToolTips(boolean);
boolean = object.GetEnableToolTips( );

Delphi

object.EnableToolTips := boolean;
boolean := object.EnableToolTips;

The EnableToolTips property syntax has these parts:

Part Description
object A TreeViewX object.
boolean A Boolean expression that specifies whether object will display tool tips.

Settings

The settings for boolean are:

Setting Description
True Causes object to display tool tips when the mouse is over a branch object.
False Prevents object from displaying tool tips when the mouse is over a branch object.

HorizontalExtent

Returns or sets a value that determines the logical width of a TreeViewX control.

Syntax

Visual Basic

object.HorizontalExtent = value
value = object.HorizontalExtent

Visual C++

object.SetHorizontalExtent(value);
value = object.GetHorizontalExtent( );

Delphi

object.HorizontalExtent := value;
value := object.HorizontalExtent;

The HorizontalExtent property syntax has these parts:

Part Description
object A TreeViewX object.
value A short integer that specifies the logical width of a TreeViewX control. The logical width is specified in pixels.

Remarks

The HorizontalExtent property specifies the logical width of a TreeViewX at run time.

If the logical width of the control is less than the physical width (i.e., the actual width of the control in pixels as it appears on screen), then the HorizontalExtent property has no effect. If the logical width is greater than the physical width, a horizontal scroll bar appears at the bottom of the control to allow the user to scroll the contents of the TreeViewX control horizontally.

Indent

The Indent property sets or returns the amount of space, in pixels, that each subsequent child level is indented from its parent in the TreeViewX control.

Syntax

Visual Basic

object.Indent = value
value = object.Indent

Visual C++

object.SetIndent(value);
value = object.GetIndent( );

Delphi

object.Indent:= value;
value := object.Indent;

The Indent property syntax has these parts:

Part Description
object A TreeViewX object.
value A short integer or constant that determines the amount of space, in pixels, that each subsequent child level is indented from its parent in the TreeViewX control.

IntegralHeight

Returns or sets a value indicating if the control displays partial items. Read only at run time.

Syntax

Visual Basic

object.IntegralHeight = boolean
boolean = object.IntegralHeight

Visual C++

object.SetIntegralHeight(boolean);
boolean = object.GetIntegralHeight( );

Delphi

object.IntegralHeight := boolean;
boolean := object.IntegralHeight;

Part Description
object A TreeViewX object.
boolean A Boolean expressionthat specifies whether object will resize itself to hide partial items.

Settings

The settings for boolean are:

Setting Description
True (Default) The TreeViewX control resizes itself to display only complete items.
False The TreeViewX control doesn't resize itself even if the item is too tall to display completely.

LineColor

Returns or sets the color used to draw lines connecting parent/child branch objects.

Syntax

Visual Basic

object.LineColor = color
color
= object.LineColor

C++

object.SetLineColor(color);
color = object.GetLineColor();

Delphi

object.LineColor := color;
color := object.LineColor;

The LineColor property syntax has these parts:

Part Description
object A TreeViewX object.
color A color value or constant as described in Settings.

Remarks

See the section Notes About Colors in the Appendix: Common Properties, Methods and Events

MultiColumn

Returns or sets a value indicating if the TreeViewX control displays the list of items in a multicolumn fashion. Read only at run time.

Syntax

Visual Basic

object.MultiColumn = boolean
boolean = object.MultiColumn

Visual C++

object.SetMultiColumn(boolean);
boolean = object.GetMultiColumn( );

Delphi

object.MultiColumn:= boolean;
boolean := object.MultiColumn;

The MultiColumn property syntax has these parts:

Part Description
object A TreeViewX object.
boolean A Boolean expression that specifies whether object will display items in a multicolumn fashion.

Settings

The settings for boolean are:

Setting Description
True The TreeViewX control displays its items in a multicolumn fashion.
False (Default) The TreeViewX control displays its items in the normal fashion.

Remarks

The TreeViewX control can display multicolumn lists in one of two modes: fixed column width mode and variable column width mode.

In the fixed column width mode (see MultiColumnStyle Property), you specify the width of each column using the ColumnWidth Property. In this mode, each column will remain a constant width no matter how the TreeViewX control is sized.

In the variable column width mode, you specify the number of columns to be displayed on the TreeViewX control by setting the NumberOfColumns Property. In this mode, the number of columns displayed on the TreeViewX control remains constant no matter how the TreeViewX control is sized.

MultiColumnStyle

Returns or sets a value indicating the style of the multicolumn display.

Syntax

Visual Basic

object.MultiColumnStyle = value
value = object.MultiColumnStyle

Visual C++

object.SetMultiColumnStyle(value);
value = object.GetMultiColumnStyle( );

Delphi

object.MultiColumnStyle:= value;
value:= object.MultiColumnStyle;

The MultiColumnStyle property syntax has these parts:

Part Description
object A TreeViewX object.
value A constant that determines the multicolumn style, as described in Settings.

Settings

The settings for value are:

Setting Description
pvtMuliColFixedWidth - 0 (Default) Fixed. Specifies that the TreeViewX control displays its items in a fixed column width mode
pvtMultiColVariableWidth - 1 Variable. Specifies that the TreeViewX control displays its items in a variable column width mode.

Remarks

The TreeViewX control can display multicolumn lists in one of two modes: fixed column width mode and variable column width mode.

In the fixed column width mode, you specify the width of each column using the ColumnWidth Property. In this mode, each column will remain a constant width no matter how the TreeViewX control is sized.

In the variable column width mode, you specify the number of columns to be displayed on the TreeViewX control by setting the NumberOfColumns Property. In this mode, the number of columns displayed on the TreeViewX control remains constant no matter how the TreeViewX control is sized.

NumberOfColumns

The NumberOfColumns property sets or returns the number of columns displayed in the TreeViewX control.

Syntax

Visual Basic

object.NumberOfColumns = value
value = object.NumberOfColumns

Visual C++

object.SetNumberOfColumns(value);
value = object.GetNumberOfColumns( );

Delphi

object.NumberOfColumns:= value;
value:= object.NumberOfColumns;

The NumberOfColumns property syntax has these parts:

Part Description
object A TreeViewX object.
value A short integer or constant specifies the number of columns displayed in a multicolumn TreeViewX control.

Remarks

The NumberOfColumns property only affects a multicolumn / variable column width TreeViewX control. That is to say, the TreeViewX control must have its MultiColumn Property set to True, and its MultiColumnStyle Property set to 1 for this property to have any effect.

ProportionalScrollBars

The ProportionalScrollBars property sets or returns a value which specifies whether or not the TreeViewX controls scroll bars are sized proportionally to the contents of the control.

Syntax

Visual Basic

object.ProportionalScrollBars = boolean
boolean = object.ProportionalScrollBars

Visual C++

object.SetProportionalScrollBars(boolean);
boolean = object.GetProportionalScrollBars( );

Delphi

object.ProportionalScrollBars:= boolean;
boolean:= object.ProportionalScrollBars;

The ProportionalScrollBars property syntax has these parts:

Part Description
object A TreeViewX object.
boolean A Boolean expression that determines whether the TreeViewX control displays its scroll bars proportionally sized to its contents.

Settings

The settings for boolean are:

Setting Description
True (Default) The TreeViewX control displays its scroll bars proportionally sized to its contents.
False The TreeViewX control displays its scroll bars in the normal fashion.

Redraw

Returns or sets whether redraw capabilities of the TreeViewX are on of off.  Setting redraw capabilties off is useful when adding many items to the TreeViewX to reduce flicker and the amount of time required to add the items.

Syntax

Visual Basic

object.Redraw = boolean
boolean = object.
Redraw

Visual C++

object.SetRedraw ( boolean );
boolean = object.GetRedraw( );

Delphi

object.Redraw := boolean;
boolean := object.Redraw;

The Redraw property syntax has these parts:

Part Description
object A TreeViewX object.
boolean A Boolean expression that specifies whether the TreeViewX can repaint itself.

Settings

The settings for boolean are:

Setting Description
True The TreeViewX control can always repaint itself.
False The TreeViewX control cannot repaint itself.

SelectedTextBackColor

Returns or sets the background color used to display selected branch objects.

Syntax

Visual Basic

object.SelectedTextBackColor = color
color
= object.SelectedTextBackColor

C++

object.SetSelectedTextBackColor(color);
color = object.GetSelectedTextBackColor();

Delphi

object.SelectedTextBackColor := color;
color := object.SelectedTextBackColor;

The SelectedTextBackColor property syntax has these parts:

Part Description
object A TreeViewX object.
color A color value or constant as described in Settings.

Remarks

See the section Notes About Colors in the Appendix: Common Properties, Methods and Events

SelectedTextForeColor

Returns or sets the foreground color used to display selected branch objects.

Syntax

Visual Basic

object.SelectedTextForeColor = color
color
= object.SelectedTextForeColor

C++

object.SetSelectedTextForeColor(color);
color = object.GetSelectedTextForeColor();

Delphi

object.SelectedTextForeColor := color;
color := object.SelectedTextForeColor;

The SelectedTextForeColor property syntax has these parts:

Part Description
object A TreeViewX object.
color A color value or constant as described in Settings.

Remarks

See the section Notes About Colors in the Appendix: Common Properties, Methods and Events

SelectMode

Returns or sets a value indicating whether a user can make multiple selections in TreeViewX control and how the multiple selections can be made.

Syntax

Visual Basic

object.SelectMode = value
value = object.
SelectMode

Visual C++

object.SetSelectMode(value);
value = object.GetSelectMode( );

Delphi

object.SelectMode:= value;
value:= object.SelectMode;

The SelectMode property syntax has these parts:

Part Description
object A TreeViewX object.
value A short integer that determines the selection mode in the TreeView.

Settings

The settings for value are:

Setting Description
pvtSelectDefault - 0 (Default) Multiple selection isn't allowed.
pvtSelectSimple - 1 Simple multiple selection. A mouse click or pressing the SPACEBAR selects or deselects an item in the list. (Arrow keys move the focus.)
pvtSelectMultiple - 2 Extended multiple selection. Pressing SHIFT and clicking the mouse or pressing SHIFT and one of the arrow keys (UP ARROW, DOWN ARROW, LEFT ARROW, and RIGHT ARROW) extends the selection from the previously selected item to the current item. Pressing CTRL and clicking the mouse selects or deselects an item in the list.

Sort

Returns a value indicating whether the elements of a control are automatically sorted alphabetically.

Syntax

Visual Basic

boolean = object.Sort

Visual C++

boolean = object.GetSort( );

Delphi

boolean:= object.Sort;

Part Description
object A TreeViewX object.
boolean A Boolean expression that specifies whether object will sort items in the list.

Settings

The settings for boolean are:

Setting Description
True List items are sorted alphabetically (case-insensitive).
False (Default) List items aren't sorted alphabetically.

Remarks

When this property is True, Visual Basic handles almost all necessary string processing to maintain alphabetic order, including changing the index numbers for items as required by the addition or removal of items.

Note Using the Add method to add an element to a specific location in the list may violate the sort order, and subsequent additions may not be correctly sorted.

StandardDefaultPicture

Returns or sets a value indicating the default picture that will be displayed next to an item in the TreeViewX control.

Syntax

Visual Basic

object.StandardDefaultPicture = value
value = object.StandardDefaultPicture

Visual C++

object.SetStandardDefaultPicture(value);
value = object.GetStandardDefaultPicture( );

Delphi

object.StandardDefaultPicture:= value;
value:= object.StandardDefaultPicture;

The StandardDefaultPicture property syntax has these parts:

Part Description
object A TreeViewX object.
value A constant that determines the default picture that will be displayed next to an item in the TreeViewX control, as described in Settings.

Settings

The settings for value are:

Setting Description
pvtNone No picture.
pvtpicFolders (Default) Folder Picture.
pvtpicBoxes1 Boxes #1 Picture.
pvtpicDocument Document Picture.
pvtpicHardDisk Hard Disk Picture.
pvtpicProgram Program File Picture.
pvtpicSystemFile System File Picture.
pvtpicBoxes2 Boxes #2 Picture.
pvtpicBoxes3 Boxes #3 Picture.
pvtpicASCIIFile ASCII File Picture.
pvtpicHelpFile Help File Picture.

Remarks

Please see the Remarks for TreeViewX images.

StandardLevelPicture

Returns or sets a value indicating the default picture that will be displayed next to an item in the TreeViewX control on a particular level.

Syntax

Visual Basic

object.StandardLevelPicture(level) = value
value = object.StandardLevelPicture(level)

Visual C++

object.SetStandardLevelPicture(level, value);
value = object.GetStandardLevelPicture(level);

Delphi

object.StandardLevelPicture[level]:= value;
value:= object.StandardLevelPicture[level];

The StandardLevelPicture property syntax has these parts:

Part Description
object A TreeViewX object.
level A numeric expression that specifies the level for which the default picture is to be set.
Value A constant that determines the default picture that will be displayed next to an item in the TreeViewX control, as described in Settings.

Settings

The settings for value are:

Setting Description
pvtNone No picture.
pvtpicFolders (Default) Folder Picture.
pvtpicBoxes1 Boxes #1 Picture.
pvtpicDocument Document Picture.
pvtpicHardDisk Hard Disk Picture.
pvtpicProgram Program File Picture.
pvtpicSystemFile System File Picture.
pvtpicBoxes2 Boxes #2 Picture.
pvtpicBoxes3 Boxes #3 Picture.
pvtpicASCIIFile ASCII File Picture.
pvtpicHelpFile Help File Picture.

Remarks

Please see the Remarks for TreeViewX images.

TabPoint

The TabPoint property sets or returns the location of tab stops in the TreeViewX control.

Syntax

Visual Basic

object.TabPoint(index) = value
value = object.TabPoint(index)

Visual C++

object.SetTabPoint(index, value);
value = object.GetTabPoint(index);

Delphi

object.TabPoint[index]:= value;
value:= object.TabPoint[index];

The TabPoint property syntax has these parts:

Part Description
object A TreeViewX object.
index A numeric expression or constant that specifies which tab point to set or return.
value A short integer or constant specifies the tab stop location, in dialog box units, from the left side of the TreeViewX control.

Remarks

The TreeViewX control must have its UseTabStops Property set to True for this property to have any effect.

If no tab stops are specified for a control, the default tab stop is two dialog box units. If only one tab stop is specified, the list box will have tab stops separated by the distance specified by that single tab stop. If more than a single tab stop is defined, a tab stop will be set for each value specified.

A dialog box unit is a horizontal or vertical distance. One horizontal dialog box unit is equal to 0.25 of the current dialog box base-width unit. These units are computed based on the height and width of the current system font. The GetDialogBaseUnits function returns the current dialog box base units, in pixels.

TabPointCount

The TabPointCount property returns the number of tab stops defined in the TreeViewX control. Read only at run time, not available at design time.

Syntax

Visual Basic

value = object.TabPointCount

Visual C++

value = object.GetTabPointCount( );

Delphi

value:= object.TabPointCount;

The TabPointCount property syntax has these parts:

Part Description
object A TreeViewX object.
value A short integer which returns the number of tab stops defined in the TreeView.

Remarks

The TreeViewX control must have its UseTabStops Property set to True for this property to have any meaning.

If no tab stops are specified for a control, the default tab stop is two dialog box units. If only one tab stop is specified, the list box will have tab stops separated by the distance specified by that single tab stop. If more than a single tab stop is defined, a tab stop will be set for each value specified.

A dialog box unit is a horizontal or vertical distance. One horizontal dialog box unit is equal to 0.25 of the current dialog box base-width unit. These units are computed based on the height and width of the current system font. The GetDialogBaseUnits function returns the current dialog box base units, in pixels.

ToolTipBackColor

Returns or sets the background color used to tool tips, should the property EnableToolTips be set to true.

Syntax

Visual Basic

object.ToolTipBackColor = color
color
= object.ToolTipBackColor

C++

object.SetToolTipBackColor(color);
color = object.GetToolTipBackColor();

Delphi

object.ToolTipBackColor := color;
color := object.ToolTipBackColor;

The ToolTipBackColor property syntax has these parts:

Part Description
object A TreeViewX object.
color A color value or constant as described in Settings.

Remarks

See the section Notes About Colors in the Appendix: Common Properties, Methods and Events

UseStateBitmaps

The UseStateBitmaps property sets or returns a boolean value indicating whether or not the TreeViewX control uses state format bitmaps.

Syntax

Visual Basic

object.UseStateBitmaps = boolean
boolean = object.UseStateBitmaps

Visual C++

object.SetUseStateBitmaps(boolean);
boolean = object.GetUseStateBitmaps( );

Delphi

object.UseStateBitmaps:= boolean;
boolean:= object.UseStateBitmaps;

The UseStateBitmaps property syntax has these parts:

Part Description
object A TreeViewX object.
boolean A Boolean expression that specifies whether the TreeViewX control interprets custom bitmaps as state format bitmaps, as described in Settings.

Settings

The settings for boolean are:

Setting Description
True (Default) The TreeViewX control control interprets custom bitmaps as state format bitmaps.
False The TreeViewX control control interprets custom bitmaps as normal bitmaps.

Remarks

When a custom bitmap is assigned to an item, the TreeViewX control can interpret the bitmap as a normal or state formatted bitmap. A normal bitmap is displayed in it’s entirety next to the item.

{bmlt examp1.bmp}

A state formatted bitmap is a bitmap that consists of three images, each placed next to each other. Only one of the three images is displayed at any given time, depending on the state of the item. The first image is displayed when the Branch object has no children, the second image is displayed when the Branch object has children and is in the open state, and the third image is displayed when the Branch object has children and is in the closed state. Each image must be the same size as the other two. Thus, only one third of the entire bitmap is displayed at any given time.

UseTabStops

Returns a value indicating whether the TreeViewX control recognizes and expands tab characters when drawing its strings. The default tab positions are 2 dialog units. (A dialog unit is a horizontal or vertical distance. One horizontal dialog unit is equal to one-fourth of the current dialog base width unit. The dialog base units are computed based on the height and width of the current system font. The GetDialogBaseUnits Windows function returns the current dialog base units in pixels.) Read only at run time.

Syntax

Visual Basic

object.UseTabStops = boolean
boolean = object.UseTabStops

Visual C++

object.SetUseTabStops(boolean);
boolean = object.GetUseTabStops( );

Delphi

object.UseTabStops:= boolean;
boolean:= object.UseTabStops;

Part Description
object A TreeViewX object.
boolean A Boolean expression that specifies whether the TreeViewX control will use tabstops.

Settings

The settings for boolean are:

Setting Description
True The TreeViewX control recognizes and expands tab characters when drawing its strings.
False (Default) The TreeViewX control does not recognize and expand tab characters when drawing its strings.

VisibleCount

The VisibleCount property returns the total number of visible items in a TreeViewX control. Read only at run time, not available at design time.

Syntax

Visual Basic

value = object. VisibleCount

Visual C++

value = object.GetVisibleCount( );

Delphi

value:= object. VisibleCount;

Part Description
object A TreeViewX object.
value A long integer that returns the number of visible items in the TreeViewX control.

Remarks

Visible items are items whose parent items are all open, as opposed to an invisible item which has one or more of its parent items closed.

TreeViewX Methods

List of Methods

The ProtoView TreeViewX control supports the following methods:

AboutBox*

BeginInPlaceEdit

ClearTabStops

EndInPlaceEdit

Find

GetEditHWHD

HitTest

* This is a common method described in the Appendix: Common Properties, Methods and Events.

BeginInPlaceEdit

Puts the current Branch object into in-place edit mode.

Syntax

Visual Basic

object.BeginInPlaceEdit

Visual C++

object.BeginInPlaceEdit( );

Delphi

object.BeginInPlaceEdit;

The BeginInPlaceEdit method syntax has these parts:

Part Description
object A TreeViewX object.

ClearTabStops

Clears all tab stops in a TreeViewX Control.

Syntax

Visual Basic

object.ClearTabStops

Visual C++

object.ClearTabStops( );

Delphi

object.ClearTabStops;

The ClearTabStops method syntax has these parts:

Part Description
object A TreeViewX object.

Remarks

To remove one tab stop from a TreeViewX control, use the TabPoint Property to set the tab stop to -1.

EndInPlaceEdit

Ends the in-place editing of the current Branch object.

Syntax

Visual Basic

object.EndInPlaceEdit

Visual C++

object.EndInPlaceEdit( );

Delphi

object.EndInPlaceEdit;

The EndInPlaceEdit method syntax has these parts:

Part Description
object A TreeViewX object.

Find

Searches for a specific item in a TreeViewX control.

Syntax

Visual Basic

object.Find relationship, relative, text

Visual C++

object.Find( relationship, relative, text );

Delphi

object.Find(relationship, relative, text );

The Find method syntax has these parts:

Part Description
object A TreeViewX object.
relationship A constant that specifies how the search for the item will proceed. This value can take on one of the manifest constants described in Settings.
relative A Branch object that specifies the relative item.
text A string that specifies the text string to search for.

Settings

The settings for relationship are:

pvtFindNext

Searches for the item following relative whose Text Property begins with text string.

pvtFindNextExact

Searches for the item following relative whose Text Property exactly matches text string.

pvtFindPrevious

Searches for the item prior to relative whose Text Property begins with text string.

pvtFindPreviousExact

Searches for the item prior to relative whose Text Propertyn exactly matches text string.

pvtFindNextSibling

Searches for the item following relative that shares the same parent as relative and whose Text Property begins with text string.

pvtFindNextSiblingExact

Searches for the item following relative that shares the same parent as relative and whose Text Property exactly matches text string.

pvtFindPreviousSibling

Searches for the item prior to relative that shares the same parent as relative and whose Text Property begins with text string.

pvtFindPreviousSiblingExact

Searches for the item prior to relative that shares the same parent as relative and whose Text Property exactly matches text string.

pvtFindNextVisible

Searches for the item following relative that is visible (i.e., an item whose parents areall open) and whose Text Property begins with text string.

pvtFindNextVisibleExact

Searches for the item following relative that is visible (i.e., an item whose parents areall open) and whose Text Property exactly matches text string.

pvtFindPreviousVisible

Searches for the item prior to relative that is visible (i.e., an item whose parents areall open) and whose Text Property begins with text string.

pvtFindPreviousVisibleExact

Searches for the item prior to relative that is visible (i.e., an item whose parents areall open) and whose Text Property exactly matches text string.

Remarks

The Find method returns a Branch Object that matches the search criteria. If no item matches the search criteria, an empty Branch object is returned.

You can use the Get method to obtain a Branch object that has a specific hierarchical relationship to a given item.

Visual Basic Example

This example searches the tree for the first Branch object that matches a partial string "Ar" in a TreeViewX control. That is to say, the Find method will find the first node in the tree that has a caption that begins with "Ar". To try this example, create a form and place a TreeViewX control on the form. Set the Name property of the control to PTreeView1. Create a menu for the form that contains the command Find (mnuFind). Paste the Sub procedure into the Declarations section of the form, and press F5.

Private Sub mnuFind_Click ()
Dim node As Branch

Set node = PTreeView1.Find(FindNext, NULL, "Ar")

End Sub

GetEditHWND

Returns a handle to a the edit control where in-place editing for a TreeViewX control occurs.

Syntax

Visual Basic

hWnd = object.GetEditHWND

Visual C++

hWnd = object.GetEditHWND( );

Delphi

hWnd := object.GetEditHWND;

The GetEditHWND property syntax has these parts:

Part Description
object A TreeViewX object.
hWnd A handle which contains the windows handle of the edit control.

Remarks

The Microsoft Windows operating environment identifies each form and control in an application by assigning it a handle, or hWnd. The hWnd property is used with Windows API calls. Many Windows operating environment functions require the hWnd of the active window as an argument.

Note Because the value of this property can change while a program is running, never store the hWnd value in a variable.

HitTest

Tries to locate a branch object at a specific spot in the TreeViewX control.  The x, y coordinate is pixels relative to the upper left corner of the TreeViewX control.  If a branch object is located at that position, a Branch object will be returned.  If no branch object is at the spot, then a Branch object which returns false to IsValid is returned.

Syntax

Visual Basic

object.HitTest x, y

Visual C++

object.HitTest( x, y );

Delphi

object.HitTest( x, y );

The HitTest method syntax has these parts:

Part Description
object A TreeViewX object.
x The x coordinate to hittest.
y The y coordinate to hittest.

TreeViewX Events

List of Events

The ProtoView TreeViewX control supports the following events:

AfterCollapse

AfterDBAddNode

AfterExpand

AfterSelChange

BeforeCollapse

BeforeDBAddNode

BeforeExpand

BeforeSelChange

DeleteItem

KeyDown*

KeyPress*

KeyUp*

InPlaceEditBegin

InPlaceEditEnd

LButtonDblClick

LButtonDown

LButtonUp

RButtonDblClick

RButtonDown

RButtonUp

* This is a common event described in the Appendix: Common Properties, Methods and Events.

AfterCollapse

The AfterCollapse event is fired after an item has been collapsed (closed).

Syntax

Visual Basic

Private Sub object_AfterCollapse(Node)

Visual C++

OnAfterCollapseObject(Node);

Delphi

Procedure AfterCollapse(Sender, Node);

The AfterCollapse event syntax has these parts:

Part Description
Node A Branch object that has been collapsed.

Remarks

When a node is collapsed in the TreeViewX control, the TreeViewX control fires the BeforeCollapse event before the node is collapsed. The user may cancel the collapse event by setting the bProcessed variable to True. If the collapse event is not canceled, the TreeViewX control collapses the item, and then fires an AfterCollapse event.

AfterDBAddNode

This event is fired after a node is added from the data source.

Syntax

Visual Basic

Private Sub object_BeforeDBAddNode(Node)

Visual C++

OnBeforeDBAddNodeObject(Node);

Delphi

Procedure BeforeDBAddNode(Sender, Node);

The AfterDBAddNode event syntax has these parts:

Part Description
Node A Branch object which represents the node just added.

Remarks

TreeViewX is bound to a database by specifying a Data control in the DataSource property at design time using the Properties window or by setting the DataSource property at runtime.  A column in the database is bound to a the TreeViewX by using the DataField property of the TreeViewX.     See the comments on data binding to the TreeView.

AfterExpand

The AfterExpand event is fired after an item has been expanded (opened).

Syntax

Visual Basic

Private Sub object_AfterExpand(Node)

Visual C++

OnAfterExpandObject(Node);

Delphi

Procedure AfterExpand(Sender, Node);

The AfterExpand event syntax has these parts:

Part Description
Node A Branch object that is being expanded.

Remarks

When a node is expanded in the TreeViewX control, the TreeViewX control fires the BeforeExpand event before the node is expanded. The user may cancel the expand event by setting the bProcessed variable to True. If the expand event is not canceled, the TreeViewX control expands the item, and then fires an AfterExpand event.

AfterSelChange

The AfterSelChange event is fired after an item is selected.

Syntax

Visual Basic

Private Sub object_AfterSelChange(Node)

Visual C++

OnAfterSelChangeObject(Node);

Delphi

Procedure AfterSelChange(Sender, Node);

The AfterSelChange event syntax has these parts:

Part Description
Node A Branch object that is has been selected.

Remarks

When a node is selected in the TreeViewX control, the TreeViewX control fires the BeforeSelChange event before the selection is made. The user may cancel the selection change by setting the bProcessed variable to True. If the selection change is not canceled, the TreeViewX control selects the item, and then fires an AfterSelChange event.

BeforeCollapse

The BeforeCollapse event is fired before an item is collapsed (closed).

Syntax

Visual Basic

Private Sub object_BeforeCollapse(Node, bProcessed)

Visual C++

OnBeforeCollapseObject(Node, bProcessed);

Delphi

Procedure BeforeCollapse(Sender, Node, bProcessed);

The BeforeCollapse event syntax has these parts:

Part Description
Node A Branch object that is being collapsed.
bProcessed A Boolean expression that specifies whether the event procedure processed the event.

Settings

The settings for bProcessed are:

Setting Description
True The TreeViewX control will ignore the collapse event.
False (Default) The node will be collapsed.

Remarks

When a node is collapsed in the TreeViewX control, the TreeViewX control fires the BeforeCollapse event before the node is collapsed. The user may cancel the collapse event by setting the bProcessed variable to True. If the collapse event is not canceled, the TreeViewX control collapses the item, and then fires an AfterCollapse event.

BeforeDBAddNode

This event is fired prior to a node being added from the data source.

Syntax

Visual Basic

Private Sub object_BeforeDBAddNode(Node, Text, bCancel)

Visual C++

OnBeforeDBAddNodeObject(Node, Text, bCancel);

Delphi

Procedure BeforeDBAddNode(Sender, Node, Text, bCancel);

The BeforeDBAddNode event syntax has these parts:

Part Description
Node A Branch object that is the parent of the node being added.
Text The text of the node being added.
bCancel A boolean variable that can be used to cancel the addition of the node.

Settings

The settings for bCancel are:

Setting Description
True The Branch object will not be added.
False (Default) The Branch object will be added.

Remarks

TreeViewX is bound to a database by specifying a Data control in the DataSource property at design time using the Properties window or by setting the DataSource property at runtime.  A column in the database is bound to a the TreeViewX by using the DataField property of the TreeViewX.     See the comments on data binding to the TreeView.

The Text parameter is passed by reference, meaning you can change the value of text before it is added.

BeforeExpand

The BeforeExpand event is fired before an item is expanded (opened).

Syntax

Visual Basic

Private Sub object_BeforeExpand(Node, bProcessed)

Visual C++

OnBeforeExpandObject(Node, bProcessed);

Delphi

Procedure BeforeExpand(Sender, Node, bProcessed);

The BeforeExpand event syntax has these parts:

Part Description
Node A Branch object that is being expanded.
bProcessed A Boolean expression that specifies whether the event procedure processed the event.

Settings

The settings for bProcessed are:

Setting Description
True The TreeViewX control will ignore the expand event.
False (Default) The node will be expanded.

Remarks

When a node is expanded in the TreeViewX control, the TreeViewX control fires the BeforeExpand event before the node is expanded. The user may cancel the expand event by setting the bProcessed variable to True. If the expand event is not canceled, the TreeViewX control expands the item, and then fires an AfterExpand event.

BeforeSelChange

The BeforeSelChange event is fired before an item is selected.

Syntax

Visual Basic

Private Sub object_BeforeSelChange(Node, bProcessed)

Visual C++

OnBeforeSelChangeObject(Node, bProcessed);

Delphi

Procedure BeforeSelChange(Sender, Node, bProcessed);

The BeforeSelChange event syntax has these parts:

Part Description
Node A Branch object that is losing the selection.
bProcessed A Boolean expression that specifies whether the event procedure processed the event.

Settings

The settings for bProcessed are:

Setting Description
True The TreeViewX control will ignore the selection change event.
False (Default) The selection change will be performed.

Remarks

When a node is selected in the TreeViewX control, the TreeViewX control fires the BeforeSelChange event before the selection is made. The user may cancel the selection change by setting the bProcessed variable to True. If the selection change is not canceled, the TreeViewX control selects the item, and then fires an AfterSelChange event.

DeleteItem

The DeleteItem event is fired when an item is about to be deleted.

Syntax

Visual Basic

Private Sub object_DeleteItem(Node)

Visual C++

OnDeleteItemObject(Node);

Delphi

Procedure DeleteItem(Sender, Node);

The DeleteItem event syntax has these parts:

Part Description
Node A Branch object that is about to be deleted.

Remarks

You can associate data with each item in the parameter property of a Branch. When the Branch object is about to be deleted, you can free any data structures you have allocated in the DeleteItem Event.

InPlaceEditBegin

The InPlaceEditBegin event is fired before an item is about to be edited by the user.

Syntax

Visual Basic

Private Sub object_InPlaceEditBegin(Node, bAllow)

Visual C++

OnInPlaceEditBeginObject(Node, bAllow);

Delphi

Procedure InPlaceEditBegin(Sender, Node, bAllow);

The InPlaceEditBegin event syntax has these parts:

Part Description
Node A Branch object that is being edited.
bAllow A Boolean expression that specifies if branch is allowed to be edited.

Settings

The settings for bAllow are:

Setting Description
True (Default) The TreeViewX control will allow the item to be edited.
False The TreeViewX control will not allow the item to be edited.

Remarks

When a selected node is single clicked, the TreeViewX control will allow that node to be edited inline.

InPlaceEditEnd

The InPlaceEditEnd event is fired before an item is about to be edited by the user.

Syntax

Visual Basic

Private Sub object_InPlaceEditEnd(Node, Text, fAllow)

Visual C++

OnInPlaceEditEndObject(Node, Text, bAllow);

Delphi

Procedure InPlaceEditEnd(Sender, Node, Text, bAllow);

The InPlaceEditEnd event syntax has these parts:

Part Description
Node A Branch object that is being edited.
Text A string which contains the new text of the item.
bAllow A Boolean expression that specifies if branch will accept the new value.

Settings

The settings for bAllow are:

Setting Description
True (Default) The TreeViewX control will assign the new text to the item.
False The TreeViewX control will not assign the new text to the item.

Remarks

When a selected node is single clicked, the TreeViewX control will allow that node to be edited inline.

LButtonDblClick

The LButtonDblClick event is fired when the left button of the mouse is double clicked over the TreeViewX control.

Syntax

Visual Basic

Private Sub object_LButtonDblClick(Node, x, y)

Visual C++

OnLButtonDblClickObject(Node, x, y);

Delphi

Procedure LButtonDblClick(Sender, Node, x, y);

The LButtonDblClick event syntax has these parts:

Part Description
Node A Branch object that is under the mouse. This will be an empty Branch object if no item is under the mouse.
x A short integer with the x position of the mouse at the time of the LButtonDblClick event.
y A short integer with the y position of the mouse at the time of the LButtonDblClick event.

LButtonDown

The LButtonDown event is fired when the left button of the mouse is pressed over the TreeViewX control.

Syntax

Visual Basic

Private Sub object_LButtonDown(Node, x, y)

Visual C++

OnLButtonDownObject(Node, x, y);

Delphi

Procedure LButtonDown(Sender, Node, x, y);

The LButtonDown event syntax has these parts:

Part Description
Node A reference to the Branch object that is under the mouse. This will be an empty Branch object if no item is under the mouse.
x A short integer with the x position of the mouse at the time of the LButtonDown event.
y A short integer with the y position of the mouse at the time of the LButtonDown event.

LButtonUp

The LButtonUp event is fired when the left button of the mouse is released over the TreeViewX control.

Syntax

Visual Basic

Private Sub object_LButtonUp(Node, x, y)

Visual C++

OnLButtonUpObject(Node, x, y);

Delphi

Procedure LButtonUp(Sender, Node, x, y);

The LButtonUp event syntax has these parts:

Part Description
Node A reference to the Branch object that is under the mouse. This will be an empty Branch object if no item is under the mouse.
x A short integer with the x position of the mouse at the time of the LButtonUp event.
y A short integer with the y position of the mouse at the time of the LButtonUp event.

RButtonDblClick

The RButtonDblClick event is fired when the right button of the mouse is double clicked over the TreeViewX control.

Syntax

Visual Basic

Private Sub object_RButtonDblClick(Node, x, y)

Visual C++

OnRButtonDblClickObject(Node, x, y);

Delphi

Procedure RButtonDblClick(Sender, Node, x, y);

The RButtonDblClick event syntax has these parts:

Part Description
Node A reference to the Branch object that is under the mouse. This will be an empty Branch object if no item is under the mouse.
x A short integer with the x position of the mouse at the time of the RButtonDblClick event.
y A short integer with the y position of the mouse at the time of the RButtonDblClick event.

RButtonDown

The RButtonDown event is fired when the right button of the mouse is pressed over the TreeViewX control.

Syntax

Visual Basic

Private Sub object_RButtonDown(Node, x, y)

Visual C++

OnRButtonDownObject(Node, x, y);

Delphi

Procedure RButtonDown(Sender, Node, x, y);

The LButtonDown event syntax has these parts:

Part Description
Node A reference to the Branch object that is under the mouse. This will be an empty Branch object if no item is under the mouse.
x A short integer with the x position of the mouse at the time of the RButtonDown event.
y A short integer with the y position of the mouse at the time of the RButtonDown event.

RButtonUp

The RButtonUp event is fired when the right button of the mouse is released over the TreeViewX control.

Syntax

Visual Basic

Private Sub object_RButtonUp(Node, x, y)

Visual C++

OnRButtonUpObject(Node, x, y);

Delphi

Procedure RButtonUp(Sender, Node, x, y);

The RButtonUp event syntax has these parts:

Part Description
Node A reference to the Branch object that is under the mouse. This will be an empty Branch object if no item is under the mouse.
x A short integer with the x position of the mouse at the time of the RButtonUp event.
y A short integer with the y position of the mouse at the time of the RButtonUp event.

Remarks for TreeViewX Images

At design time, you can transfer a graphic with the Clipboard using the Copy, Cut, and Paste commands on the Edit menu. At run time, you can use Clipboard methods such as GetData, SetData, and GetFormat with the nontext Clipboard constants vbCFBitmap, vbCFMetafile, and vbCFDIB, which are listed in the Visual Basic (VB) object library in the Object Browser.

When setting a picture property at design time, the graphic is saved and loaded with the form. If you create an executable file, the file contains the image.

Note At run time, a picture property can be set to any other object's Picture property, or you can assign it the graphic returned by the LoadPicture function.

The TreeViewX control only supports bitmap images in a picture property.

For the image to display, the EnableBitmaps Property must be set to TRUE. The way in which a custom bitmap is interpreted depends on the value of the UseStateBitmaps Property.

When a custom bitmap is assigned to an item, the TreeViewX control can interpret the bitmap as a normal or state formatted bitmap. A normal bitmap is displayed in it’s entirety next to the item. The interpretation of custom bitmaps depends on the setting of the UseStateBitmaps Property.

The picture to be displayed depends on a number of other settings. The picture displayed next to an item depends on the following rules:

CustomItemPicture Property

This picture will be displayed next to the item. If not set to None, this setting overrides all following properties.

StandardItemPicture Property

If the CustomItemPicture property is set to None, then the StandardItemPicture property specifies the picture that will be displayed next to the item. If not set to None, this setting overrides all following properties.

CustomLevelPicture Property

If both the CustomItemPicture and StandardItemPicture are set to None, then the picture displayed next to the item will depend on this setting. If not set to None for the level on which the item resides, the CustomLevelPicture will be displayed next to the item. If not set to None, this setting overrides all following properties.

StandardLevelPicture Property

If the CustomItemPicture, StandardItemPicture, and the CustomLevelPicture for the level on which this item resides are all set to None, then the picture displayed next to the item will depend on this setting. If not set to None for the level on which the item resides, the StandardLevelPicture will be displayed next to the item. If not set to None, this setting overrides all following properties.

CustomDefaultPicture Property

If all of the above properties are set to None, then the picture displayed next to the item will depend on this setting. If not set to None, the CustomDefaultPicture will be displayed next to the item. If not set to None, this setting overrides the StandardDefaultPicture.

StandardDefaultPicture Property

This is the default picture that will be displayed next to an item. This property is always set to a picture and can never be set to None. If all the above properties are set to None, then this will be the picture that will be displayed next to the item.