System.Windows.Forms.TreeView.CheckBoxes Property

Gets or sets a value indicating whether check boxes are displayed next to the tree nodes in the tree view control.

Syntax

[System.ComponentModel.DefaultValue(false)]
public bool CheckBoxes { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

A check box is displayed to the left of both the tree node label and tree node System.Drawing.Image, if any. Check boxes allow the user to select more than one tree node at a time.

When the TreeView.CheckBoxes property of a System.Windows.Forms.TreeView is set to true, and the TreeView.StateImageList property is set, each System.Windows.Forms.TreeNode that is contained in the System.Windows.Forms.TreeView displays the first and second images from the TreeView.StateImageList to indicate an unchecked or checked state, respectively. However, the displayed images may be different if the following situation occurs: If the TreeView.SelectedImageIndex of the node is set to a value other than 0 or 1, and the TreeView.CheckBoxes property of the parent System.Windows.Forms.TreeView is set to false, the TreeView.SelectedImageIndex will not automatically reset to -1 to indicate it is not set. In this case, the state image at the indicated index position is shown. If TreeView.CheckBoxes is set to true again, the first and second images of the TreeView.StateImageList are shown to indicate a checked or unchecked state, respectively.

Note:

When setting the TreeView.CheckBoxes property at run time, the System.Windows.Forms.TreeView handle is recreated (see Control.RecreateHandle) to update the control's appearance. This causes all tree nodes to be collapsed, with the exception of the selected System.Windows.Forms.TreeNode.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0