[Overview][Constants][Types][Classes][Procedures and functions][Index] | Reference for unit 'ComCtrls' (#lcl)

# TCustomTreeView.ConsistencyCheck

Verifies that values are updated and valid for the tree view control.

## Declaration

Source position: comctrls.pp line 3711

`public procedure TCustomTreeView.ConsistencyCheck;`

## Description

ConsistencyCheck is a method used to validate and/or update property and member values in the control. It raises an Exception (catchable in the debugger) for invalid property values in the control, including:

Canvas
  Raises the exception if Canvas is not assigned.
DefaultItemHeight
  Raises the exception if DefaultItemHeight has a negative value.
FIndent member
  Raises the exception if FIndent has a negative value.
FMaxRight member
  Raises the exception if FMaxRight has a negative value.
IsEditing / Selected
  Raises the exception if IsEditing is True and Selected is unassigned.
Selected
  Raises the exception if the node in Selected is not visible.
Items
  Raises the exception if Items has not been assigned.

The Items property has additional validations performed for its property values. The ConsistencyCheck method in Items is called to verify node counts, update counts, index values, and hierarchy levels in the container. An Exception is raised for error conditions in these items as well.

Values in the States property are examined and updated (when needed) to refresh the display coordinates for tree nodes, the maximum width for the expanded nodes in the control, and the levels in the tree hierarchy. These operations may also raise an Exception for invalid states or values.

ConsistencyCheck is called from the WriteDebugReport method.