Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
4280 lines (3808 sloc) 321 KB
<Type Name="TreeView" FullName="System.Windows.Forms.TreeView">
<TypeSignature Language="C#" Value="public class TreeView : System.Windows.Forms.Control" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit TreeView extends System.Windows.Forms.Control" />
<TypeSignature Language="DocId" Value="T:System.Windows.Forms.TreeView" />
<TypeSignature Language="VB.NET" Value="Public Class TreeView&#xA;Inherits Control" />
<TypeSignature Language="C++ CLI" Value="public ref class TreeView : System::Windows::Forms::Control" />
<TypeSignature Language="F#" Value="type TreeView = class&#xA; inherit Control" />
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Windows.Forms.Control</BaseTypeName>
</Base>
<Interfaces />
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultEvent("AfterSelect")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DefaultProperty("Nodes")</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netcore-3.0">
<AttributeName>System.ComponentModel.Designer("System.Windows.Forms.Design.TreeViewDesigner, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netcore-3.0">
<AttributeName>System.Runtime.InteropServices.ComVisible(true)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netcore-3.0">
<AttributeName>System.Windows.Forms.Docking(System.Windows.Forms.DockingBehavior.Ask)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-1.1">
<AttributeName>System.ComponentModel.Designer("System.Windows.Forms.Design.TreeViewDesigner, System.Design, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5">
<AttributeName>System.ComponentModel.Designer("System.Windows.Forms.Design.TreeViewDesigner, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netcore-3.0">
<AttributeName>System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Displays a hierarchical collection of labeled items, each represented by a <see cref="T:System.Windows.Forms.TreeNode" />.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.TreeView.Nodes%2A> collection holds all the <xref:System.Windows.Forms.TreeNode> objects that are assigned to the <xref:System.Windows.Forms.TreeView> control. The tree nodes in this collection are referred to as the root tree nodes. Any tree node that is subsequently added to a root tree node is referred to as a child node. Because each <xref:System.Windows.Forms.TreeNode> can contain a collection of other <xref:System.Windows.Forms.TreeNode> objects, you might find it difficult to determine your location in the tree structure when you iterate through the collection. You can parse the <xref:System.Windows.Forms.TreeNode.FullPath%2A?displayProperty=nameWithType> string by using the <xref:System.Windows.Forms.TreeView.PathSeparator%2A> string value to determine where a <xref:System.Windows.Forms.TreeNode> label begins and ends.
You can display images next to the tree nodes by assigning an <xref:System.Windows.Forms.ImageList> to the <xref:System.Windows.Forms.TreeView.ImageList%2A> property and referencing the index value of an <xref:System.Drawing.Image> in the <xref:System.Windows.Forms.ImageList> to assign that <xref:System.Drawing.Image>. Use the following properties to assign images:
- Set the <xref:System.Windows.Forms.TreeView.ImageIndex%2A> property to the index value of the <xref:System.Drawing.Image> that you want to display when a tree node is not selected.
- Set the <xref:System.Windows.Forms.TreeView.SelectedImageIndex%2A> property to the index value of the <xref:System.Drawing.Image> that you want to display when a tree node is selected.
The images referenced by the <xref:System.Windows.Forms.TreeView.ImageIndex%2A> and <xref:System.Windows.Forms.TreeView.SelectedImageIndex%2A> property values are the default images displayed by all the tree nodes that are assigned to the <xref:System.Windows.Forms.TreeView.Nodes%2A> collection. Individual tree nodes can override the default images by setting the <xref:System.Windows.Forms.TreeNode.ImageIndex%2A?displayProperty=nameWithType> and <xref:System.Windows.Forms.TreeNode.SelectedImageIndex%2A?displayProperty=nameWithType> properties.
The state images displayed in the <xref:System.Windows.Forms.TreeView> are 16 x 16 pixels by default. Setting the <xref:System.Windows.Forms.ImageList.ImageSize%2A> property of the <xref:System.Windows.Forms.TreeView.StateImageList%2A> will have no effect on how the images are displayed. However, the state images are resized according to the system DPI setting when the app.config file contains the following entry:
```
<appSettings>
<add key="EnableWindowsFormsHighDpiAutoResizing" value="true" />
</appSettings>
```
Tree nodes can be expanded to display the next level of child tree nodes. The user can expand the <xref:System.Windows.Forms.TreeNode> by clicking the plus-sign (+) button, if one is displayed next to the <xref:System.Windows.Forms.TreeNode>, or you can expand the <xref:System.Windows.Forms.TreeNode> by calling the <xref:System.Windows.Forms.TreeNode.Expand%2A?displayProperty=nameWithType> method. To expand all the child tree node levels in the <xref:System.Windows.Forms.TreeNode.Nodes%2A> collection, call the <xref:System.Windows.Forms.TreeNode.ExpandAll%2A> method. You can collapse the child <xref:System.Windows.Forms.TreeNode> level by calling the <xref:System.Windows.Forms.TreeNode.Collapse%2A?displayProperty=nameWithType> method, or the user can press the minus-sign (-) button, if one is displayed next to the <xref:System.Windows.Forms.TreeNode>. You can also call the <xref:System.Windows.Forms.TreeNode.Toggle%2A?displayProperty=nameWithType> method to alternate between the expanded and collapsed states.
Tree nodes can optionally display check boxes. To display the check boxes, set the <xref:System.Windows.Forms.TreeView.CheckBoxes%2A> property of the <xref:System.Windows.Forms.TreeView> to `true`. The <xref:System.Windows.Forms.TreeNode.Checked%2A> property is set to `true` for tree nodes that are in a checked state.
> [!NOTE]
> Setting the <xref:System.Windows.Forms.TreeNode.Checked%2A?displayProperty=nameWithType> property from within the <xref:System.Windows.Forms.TreeView.BeforeCheck> or <xref:System.Windows.Forms.TreeView.AfterCheck> event causes the event to be raised multiple times and can result in unexpected behavior. For example, you might set the <xref:System.Windows.Forms.TreeNode.Checked%2A> property in the event handler when you are recursively updating the child nodes so that the user does not have to expand and check each one individually. To prevent the event from being raised multiple times, add logic to your event handler that only executes your recursive code if the <xref:System.Windows.Forms.TreeViewEventArgs.Action%2A> property of the <xref:System.Windows.Forms.TreeViewEventArgs> is not set to <xref:System.Windows.Forms.TreeViewAction.Unknown?displayProperty=nameWithType>. For an example of how to do this, see the Example section of the <xref:System.Windows.Forms.TreeView.AfterCheck> or <xref:System.Windows.Forms.TreeView.BeforeCheck> events.
You can change the appearance of the <xref:System.Windows.Forms.TreeView> control by setting some of its display and style properties. Setting <xref:System.Windows.Forms.TreeView.ShowPlusMinus%2A> to `true` displays a plus-sign or minus-sign button next to each <xref:System.Windows.Forms.TreeNode> that can be expanded or collapsed, respectively. Setting the <xref:System.Windows.Forms.TreeView.ShowRootLines%2A> property to `true` causes the <xref:System.Windows.Forms.TreeView> to display lines that join all the root tree nodes together. You can display lines that connect child tree nodes to their root node by setting the <xref:System.Windows.Forms.TreeView.ShowLines%2A> property to `true`. Setting the <xref:System.Windows.Forms.TreeView.HotTracking%2A> property to `true` changes the appearance of the tree node labels as the mouse pointer passes over them. When hot-tracked, the tree node labels take on the appearance of a hyperlink. You can also completely customize the appearance of the <xref:System.Windows.Forms.TreeView> control. To do this, set the <xref:System.Windows.Forms.TreeView.DrawMode%2A> property to a value other than <xref:System.Windows.Forms.TreeViewDrawMode.Normal?displayProperty=nameWithType> and handle the <xref:System.Windows.Forms.TreeView.DrawNode> event.
> [!NOTE]
> When setting the <xref:System.Windows.Forms.TreeView.CheckBoxes%2A>, <xref:System.Windows.Forms.TreeView.Scrollable%2A>, <xref:System.Windows.Forms.TreeView.ImageIndex%2A>, and <xref:System.Windows.Forms.TreeView.SelectedImageIndex%2A> properties at run time, the <xref:System.Windows.Forms.TreeView> handle is recreated (see <xref:System.Windows.Forms.Control.RecreateHandle%2A?displayProperty=nameWithType>) to update the control's appearance. This causes all tree nodes to be collapsed, except for the selected <xref:System.Windows.Forms.TreeNode>.
## Examples
The following code example demonstrates the use of the <xref:System.Windows.Forms.TreeView> control.
[!code-csharp[TreeViewMisc#10](~/samples/snippets/csharp/VS_Snippets_Winforms/TreeViewMisc/cs/form1.cs#10)]
[!code-vb[TreeViewMisc#10](~/samples/snippets/visualbasic/VS_Snippets_Winforms/TreeViewMisc/vb/form1.vb#10)]
The following, more complex code example displays customer information in a <xref:System.Windows.Forms.TreeView> control. The root tree nodes display customer names, and the child tree nodes display the order numbers assigned to each customer. In this example, 1,000 customers are displayed with 15 orders each. The repainting of the <xref:System.Windows.Forms.TreeView> is suppressed by using the <xref:System.Windows.Forms.TreeView.BeginUpdate%2A> and <xref:System.Windows.Forms.TreeView.EndUpdate%2A> methods, and a wait <xref:System.Windows.Forms.Cursor> is displayed while the <xref:System.Windows.Forms.TreeView> creates and paints the <xref:System.Windows.Forms.TreeNode> objects. This example requires that you have a `Customer` object that can hold a collection of `Order` objects. It also requires that you have a cursor file that is named `MyWait.cur` in the application directory and that you have created an instance of a <xref:System.Windows.Forms.TreeView> control on a <xref:System.Windows.Forms.Form>.
[!code-cpp[TreeView#1](~/samples/snippets/cpp/VS_Snippets_Winforms/TreeView/CPP/treeview.cpp#1)]
[!code-csharp[TreeView#1](~/samples/snippets/csharp/VS_Snippets_Winforms/TreeView/CS/treeview.cs#1)]
[!code-vb[TreeView#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/TreeView/VB/treeview.vb#1)]
]]></format>
</remarks>
<altmember cref="T:System.Windows.Forms.TreeNode" />
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public TreeView ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.TreeView.#ctor" />
<MemberSignature Language="VB.NET" Value="Public Sub New ()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; TreeView();" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters />
<Docs>
<summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.TreeView" /> class.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following code example demonstrates how to change the collapse state of a <xref:System.Windows.Forms.TreeView> so that all the checked nodes are visible. First, all the nodes are expanded, and a handler is added for the <xref:System.Windows.Forms.TreeView.BeforeCollapse> event. Next, all the nodes are collapsed. The <xref:System.Windows.Forms.TreeView.BeforeCollapse> event handler determines whether a given node has child nodes that are checked. If a node has checked children, the collapse is canceled for that node. In order to allow standard node collapse when the minus sign next to a node is clicked, the <xref:System.Windows.Forms.TreeView.BeforeCollapse> event handler is then removed.
This behavior can also be implemented by handling the <xref:System.Windows.Forms.TreeView.BeforeExpand> event, as illustrated in the example for that topic.
[!code-cpp[TreeViewShowCheckedNodes2#1](~/samples/snippets/cpp/VS_Snippets_Winforms/TreeViewShowCheckedNodes2/CPP/treeviewshowcheckednodes2.cpp#1)]
[!code-csharp[TreeViewShowCheckedNodes2#1](~/samples/snippets/csharp/VS_Snippets_Winforms/TreeViewShowCheckedNodes2/CS/treeviewshowcheckednodes2.cs#1)]
[!code-vb[TreeViewShowCheckedNodes2#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/TreeViewShowCheckedNodes2/VB/treeviewshowcheckednodes2.vb#1)]
]]></format>
</remarks>
<altmember cref="T:System.Windows.Forms.TreeView" />
</Docs>
</Member>
<Member MemberName="AfterCheck">
<MemberSignature Language="C#" Value="public event System.Windows.Forms.TreeViewEventHandler AfterCheck;" />
<MemberSignature Language="ILAsm" Value=".event class System.Windows.Forms.TreeViewEventHandler AfterCheck" />
<MemberSignature Language="DocId" Value="E:System.Windows.Forms.TreeView.AfterCheck" />
<MemberSignature Language="VB.NET" Value="Public Custom Event AfterCheck As TreeViewEventHandler " />
<MemberSignature Language="C++ CLI" Value="public:&#xA; event System::Windows::Forms::TreeViewEventHandler ^ AfterCheck;" />
<MemberSignature Language="F#" Value="member this.AfterCheck : System.Windows.Forms.TreeViewEventHandler " Usage="member this.AfterCheck : System.Windows.Forms.TreeViewEventHandler " />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Forms.TreeViewEventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs after the tree node check box is checked.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Setting the <xref:System.Windows.Forms.TreeNode.Checked%2A?displayProperty=nameWithType> property from within a <xref:System.Windows.Forms.TreeView.BeforeCheck> or <xref:System.Windows.Forms.TreeView.AfterCheck> event handler causes the event to be raised multiple times and can result in unexpected behavior. To prevent the event from being raised multiple times, add logic to your event handler that only executes your recursive code if the <xref:System.Windows.Forms.TreeViewEventArgs.Action%2A> property of the <xref:System.Windows.Forms.TreeViewEventArgs> is not set to <xref:System.Windows.Forms.TreeViewAction.Unknown?displayProperty=nameWithType>.
For more information about handling events, see [Handling and Raising Events](~/docs/standard/events/index.md).
## Examples
The following code example updates all the child tree nodes of a <xref:System.Windows.Forms.TreeNode> when the user changes its checked state. This code requires that you have a <xref:System.Windows.Forms.Form> with a <xref:System.Windows.Forms.TreeView> that has <xref:System.Windows.Forms.TreeNode> objects in its <xref:System.Windows.Forms.TreeNodeCollection>. The <xref:System.Windows.Forms.TreeNodeCollection> should have tree nodes with child nodes.
[!code-cpp[TreeView.AfterCheck_BeforeCheck#1](~/samples/snippets/cpp/VS_Snippets_Winforms/TreeView.AfterCheck_BeforeCheck/CPP/tn_checked.cpp#1)]
[!code-csharp[TreeView.AfterCheck_BeforeCheck#1](~/samples/snippets/csharp/VS_Snippets_Winforms/TreeView.AfterCheck_BeforeCheck/CS/tn_checked.cs#1)]
[!code-vb[TreeView.AfterCheck_BeforeCheck#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/TreeView.AfterCheck_BeforeCheck/VB/tn_checked.vb#1)]
]]></format>
</remarks>
<altmember cref="P:System.Windows.Forms.TreeView.CheckBoxes" />
<altmember cref="M:System.Windows.Forms.TreeView.OnAfterCheck(System.Windows.Forms.TreeViewEventArgs)" />
<altmember cref="E:System.Windows.Forms.TreeView.BeforeCheck" />
<altmember cref="M:System.Windows.Forms.TreeView.OnBeforeCheck(System.Windows.Forms.TreeViewCancelEventArgs)" />
</Docs>
</Member>
<Member MemberName="AfterCollapse">
<MemberSignature Language="C#" Value="public event System.Windows.Forms.TreeViewEventHandler AfterCollapse;" />
<MemberSignature Language="ILAsm" Value=".event class System.Windows.Forms.TreeViewEventHandler AfterCollapse" />
<MemberSignature Language="DocId" Value="E:System.Windows.Forms.TreeView.AfterCollapse" />
<MemberSignature Language="VB.NET" Value="Public Custom Event AfterCollapse As TreeViewEventHandler " />
<MemberSignature Language="C++ CLI" Value="public:&#xA; event System::Windows::Forms::TreeViewEventHandler ^ AfterCollapse;" />
<MemberSignature Language="F#" Value="member this.AfterCollapse : System.Windows.Forms.TreeViewEventHandler " Usage="member this.AfterCollapse : System.Windows.Forms.TreeViewEventHandler " />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Forms.TreeViewEventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs after the tree node is collapsed.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
For more information about how to handle events, see [Handling and Raising Events](~/docs/standard/events/index.md).
## Examples
The following code example updates all the child tree nodes of a <xref:System.Windows.Forms.TreeNode> when the user changes its checked state. This code requires that you have a <xref:System.Windows.Forms.Form> with a <xref:System.Windows.Forms.TreeView> that has <xref:System.Windows.Forms.TreeNode> objects in its <xref:System.Windows.Forms.TreeNodeCollection>. The <xref:System.Windows.Forms.TreeNodeCollection> should have tree nodes with child nodes.
[!code-cpp[TreeView.AfterCheck_BeforeCheck#1](~/samples/snippets/cpp/VS_Snippets_Winforms/TreeView.AfterCheck_BeforeCheck/CPP/tn_checked.cpp#1)]
[!code-csharp[TreeView.AfterCheck_BeforeCheck#1](~/samples/snippets/csharp/VS_Snippets_Winforms/TreeView.AfterCheck_BeforeCheck/CS/tn_checked.cs#1)]
[!code-vb[TreeView.AfterCheck_BeforeCheck#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/TreeView.AfterCheck_BeforeCheck/VB/tn_checked.vb#1)]
]]></format>
</remarks>
<altmember cref="M:System.Windows.Forms.TreeView.OnAfterCollapse(System.Windows.Forms.TreeViewEventArgs)" />
<altmember cref="E:System.Windows.Forms.TreeView.BeforeCollapse" />
<altmember cref="M:System.Windows.Forms.TreeView.OnBeforeCollapse(System.Windows.Forms.TreeViewCancelEventArgs)" />
</Docs>
</Member>
<Member MemberName="AfterExpand">
<MemberSignature Language="C#" Value="public event System.Windows.Forms.TreeViewEventHandler AfterExpand;" />
<MemberSignature Language="ILAsm" Value=".event class System.Windows.Forms.TreeViewEventHandler AfterExpand" />
<MemberSignature Language="DocId" Value="E:System.Windows.Forms.TreeView.AfterExpand" />
<MemberSignature Language="VB.NET" Value="Public Custom Event AfterExpand As TreeViewEventHandler " />
<MemberSignature Language="C++ CLI" Value="public:&#xA; event System::Windows::Forms::TreeViewEventHandler ^ AfterExpand;" />
<MemberSignature Language="F#" Value="member this.AfterExpand : System.Windows.Forms.TreeViewEventHandler " Usage="member this.AfterExpand : System.Windows.Forms.TreeViewEventHandler " />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Forms.TreeViewEventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs after the tree node is expanded.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
For more information about how to handle events, see [Handling and Raising Events](~/docs/standard/events/index.md).
## Examples
The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.TreeView.AfterExpand> event. This report helps you learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>.
To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.TreeView> named `TreeView1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.TreeView.AfterExpand> event.
[!code-csharp[System.Windows.Forms.EventExamples#631](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/CS/EventExamples.cs#631)]
[!code-vb[System.Windows.Forms.EventExamples#631](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb#631)]
]]></format>
</remarks>
<altmember cref="M:System.Windows.Forms.TreeView.OnAfterExpand(System.Windows.Forms.TreeViewEventArgs)" />
<altmember cref="E:System.Windows.Forms.TreeView.BeforeExpand" />
<altmember cref="M:System.Windows.Forms.TreeView.OnBeforeExpand(System.Windows.Forms.TreeViewCancelEventArgs)" />
</Docs>
</Member>
<Member MemberName="AfterLabelEdit">
<MemberSignature Language="C#" Value="public event System.Windows.Forms.NodeLabelEditEventHandler AfterLabelEdit;" />
<MemberSignature Language="ILAsm" Value=".event class System.Windows.Forms.NodeLabelEditEventHandler AfterLabelEdit" />
<MemberSignature Language="DocId" Value="E:System.Windows.Forms.TreeView.AfterLabelEdit" />
<MemberSignature Language="VB.NET" Value="Public Custom Event AfterLabelEdit As NodeLabelEditEventHandler " />
<MemberSignature Language="C++ CLI" Value="public:&#xA; event System::Windows::Forms::NodeLabelEditEventHandler ^ AfterLabelEdit;" />
<MemberSignature Language="F#" Value="member this.AfterLabelEdit : System.Windows.Forms.NodeLabelEditEventHandler " Usage="member this.AfterLabelEdit : System.Windows.Forms.NodeLabelEditEventHandler " />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Forms.NodeLabelEditEventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs after the tree node label text is edited.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
For more information about how to handle events, see [Handling and Raising Events](~/docs/standard/events/index.md).
## Examples
The following code example lets the user edit nonroot tree nodes by using a <xref:System.Windows.Forms.ContextMenu>. When the user right clicks the mouse, the <xref:System.Windows.Forms.TreeNode> at that position is determined and stored in a variable named `mySelectedNode`. If a nonroot tree node was selected, it is put into an editable state, which allows the user to edit the node label. After the user stops editing the tree node label, the new label text is evaluated and saved. For this example, several characters are considered not valid in the label text. If one of the invalid characters is in the label string, or the string is empty, the user is notified of the error and the label is returned to its previous text.
[!code-cpp[classic treenode.beginedit example#1](~/samples/snippets/cpp/VS_Snippets_CLR_Classic/classic TreeNode.BeginEdit Example/CPP/source.cpp#1)]
[!code-csharp[classic treenode.beginedit example#1](~/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic TreeNode.BeginEdit Example/CS/source.cs#1)]
[!code-vb[classic treenode.beginedit example#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_Classic/classic TreeNode.BeginEdit Example/VB/source.vb#1)]
]]></format>
</remarks>
<altmember cref="M:System.Windows.Forms.TreeView.OnAfterLabelEdit(System.Windows.Forms.NodeLabelEditEventArgs)" />
<altmember cref="E:System.Windows.Forms.TreeView.BeforeLabelEdit" />
<altmember cref="M:System.Windows.Forms.TreeView.OnBeforeLabelEdit(System.Windows.Forms.NodeLabelEditEventArgs)" />
</Docs>
</Member>
<Member MemberName="AfterSelect">
<MemberSignature Language="C#" Value="public event System.Windows.Forms.TreeViewEventHandler AfterSelect;" />
<MemberSignature Language="ILAsm" Value=".event class System.Windows.Forms.TreeViewEventHandler AfterSelect" />
<MemberSignature Language="DocId" Value="E:System.Windows.Forms.TreeView.AfterSelect" />
<MemberSignature Language="VB.NET" Value="Public Custom Event AfterSelect As TreeViewEventHandler " />
<MemberSignature Language="C++ CLI" Value="public:&#xA; event System::Windows::Forms::TreeViewEventHandler ^ AfterSelect;" />
<MemberSignature Language="F#" Value="member this.AfterSelect : System.Windows.Forms.TreeViewEventHandler " Usage="member this.AfterSelect : System.Windows.Forms.TreeViewEventHandler " />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Forms.TreeViewEventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs after the tree node is selected.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This event does not occur when the node is unselected. To detect whether the selection was cleared, you can test the <xref:System.Windows.Forms.TreeNode.IsSelected%2A?displayProperty=nameWithType> property.
For more information about handling events, see [Handling and Raising Events](~/docs/standard/events/index.md).
## Examples
The following code example demonstrates how to use the <xref:System.Windows.Forms.TreeViewAction> enumeration. To run this example, paste the following code in a form that contains a <xref:System.Windows.Forms.TreeView> control named `TreeView1`. This example requires that `TreeView1` is populated with items and the <xref:System.Windows.Forms.TreeView.AfterSelect> event is connected to the event handler defined in the sample.
[!code-cpp[System.Windows.Forms.TreeViewAndPrintPreview#2](~/samples/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.TreeViewAndPrintPreview/CPP/form1.cpp#2)]
[!code-csharp[System.Windows.Forms.TreeViewAndPrintPreview#2](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.TreeViewAndPrintPreview/CS/form1.cs#2)]
[!code-vb[System.Windows.Forms.TreeViewAndPrintPreview#2](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TreeViewAndPrintPreview/VB/form1.vb#2)]
]]></format>
</remarks>
<altmember cref="M:System.Windows.Forms.TreeView.OnAfterSelect(System.Windows.Forms.TreeViewEventArgs)" />
<altmember cref="E:System.Windows.Forms.TreeView.BeforeSelect" />
<altmember cref="M:System.Windows.Forms.TreeView.OnBeforeSelect(System.Windows.Forms.TreeViewCancelEventArgs)" />
<altmember cref="E:System.Windows.Forms.Control.MouseUp" />
<altmember cref="P:System.Windows.Forms.TreeNode.IsSelected" />
</Docs>
</Member>
<Member MemberName="BackColor">
<MemberSignature Language="C#" Value="public override System.Drawing.Color BackColor { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Drawing.Color BackColor" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.TreeView.BackColor" />
<MemberSignature Language="VB.NET" Value="Public Overrides Property BackColor As Color" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::Drawing::Color BackColor { System::Drawing::Color get(); void set(System::Drawing::Color value); };" />
<MemberSignature Language="F#" Value="member this.BackColor : System.Drawing.Color with get, set" Usage="System.Windows.Forms.TreeView.BackColor" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Drawing.Color</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the background color for the control.</summary>
<value>A <see cref="T:System.Drawing.Color" /> that represents the background color of the control. The default is the value of the <see cref="P:System.Windows.Forms.Control.DefaultBackColor" /> property.</value>
<remarks>To be added.</remarks>
<altmember cref="P:System.Windows.Forms.Control.BackColor" />
</Docs>
</Member>
<Member MemberName="BackgroundImage">
<MemberSignature Language="C#" Value="public override System.Drawing.Image BackgroundImage { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Drawing.Image BackgroundImage" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.TreeView.BackgroundImage" />
<MemberSignature Language="VB.NET" Value="Public Overrides Property BackgroundImage As Image" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::Drawing::Image ^ BackgroundImage { System::Drawing::Image ^ get(); void set(System::Drawing::Image ^ value); };" />
<MemberSignature Language="F#" Value="member this.BackgroundImage : System.Drawing.Image with get, set" Usage="System.Windows.Forms.TreeView.BackgroundImage" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Drawing.Image</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or set the background image for the <see cref="T:System.Windows.Forms.TreeView" /> control.</summary>
<value>The <see cref="T:System.Drawing.Image" /> that is the background image for the <see cref="T:System.Windows.Forms.TreeView" /> control.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This property is not relevant for this class.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="BackgroundImageChanged">
<MemberSignature Language="C#" Value="public event EventHandler BackgroundImageChanged;" />
<MemberSignature Language="ILAsm" Value=".event class System.EventHandler BackgroundImageChanged" />
<MemberSignature Language="DocId" Value="E:System.Windows.Forms.TreeView.BackgroundImageChanged" />
<MemberSignature Language="VB.NET" Value="Public Custom Event BackgroundImageChanged As EventHandler " />
<MemberSignature Language="C++ CLI" Value="public:&#xA; event EventHandler ^ BackgroundImageChanged;" />
<MemberSignature Language="F#" Value="member this.BackgroundImageChanged : EventHandler " Usage="member this.BackgroundImageChanged : System.EventHandler " />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.EventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs when the <see cref="P:System.Windows.Forms.TreeView.BackgroundImage" /> property changes.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="BackgroundImageLayout">
<MemberSignature Language="C#" Value="public override System.Windows.Forms.ImageLayout BackgroundImageLayout { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Windows.Forms.ImageLayout BackgroundImageLayout" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.TreeView.BackgroundImageLayout" />
<MemberSignature Language="VB.NET" Value="Public Overrides Property BackgroundImageLayout As ImageLayout" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::Windows::Forms::ImageLayout BackgroundImageLayout { System::Windows::Forms::ImageLayout get(); void set(System::Windows::Forms::ImageLayout value); };" />
<MemberSignature Language="F#" Value="member this.BackgroundImageLayout : System.Windows.Forms.ImageLayout with get, set" Usage="System.Windows.Forms.TreeView.BackgroundImageLayout" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netcore-3.0">
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netcore-3.0">
<AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Windows.Forms.ImageLayout</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the layout of the background image for the <see cref="T:System.Windows.Forms.TreeView" /> control.</summary>
<value>One of the <see cref="T:System.Windows.Forms.ImageLayout" /> values. The default is <see cref="F:System.Windows.Forms.ImageLayout.Tile" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This property/method/event is not relevant for this class.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="BackgroundImageLayoutChanged">
<MemberSignature Language="C#" Value="public event EventHandler BackgroundImageLayoutChanged;" />
<MemberSignature Language="ILAsm" Value=".event class System.EventHandler BackgroundImageLayoutChanged" />
<MemberSignature Language="DocId" Value="E:System.Windows.Forms.TreeView.BackgroundImageLayoutChanged" />
<MemberSignature Language="VB.NET" Value="Public Custom Event BackgroundImageLayoutChanged As EventHandler " />
<MemberSignature Language="C++ CLI" Value="public:&#xA; event EventHandler ^ BackgroundImageLayoutChanged;" />
<MemberSignature Language="F#" Value="member this.BackgroundImageLayoutChanged : EventHandler " Usage="member this.BackgroundImageLayoutChanged : System.EventHandler " />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netcore-3.0">
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netcore-3.0">
<AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.EventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs when the <see cref="P:System.Windows.Forms.TreeView.BackgroundImageLayout" /> property changes.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="BeforeCheck">
<MemberSignature Language="C#" Value="public event System.Windows.Forms.TreeViewCancelEventHandler BeforeCheck;" />
<MemberSignature Language="ILAsm" Value=".event class System.Windows.Forms.TreeViewCancelEventHandler BeforeCheck" />
<MemberSignature Language="DocId" Value="E:System.Windows.Forms.TreeView.BeforeCheck" />
<MemberSignature Language="VB.NET" Value="Public Custom Event BeforeCheck As TreeViewCancelEventHandler " />
<MemberSignature Language="C++ CLI" Value="public:&#xA; event System::Windows::Forms::TreeViewCancelEventHandler ^ BeforeCheck;" />
<MemberSignature Language="F#" Value="member this.BeforeCheck : System.Windows.Forms.TreeViewCancelEventHandler " Usage="member this.BeforeCheck : System.Windows.Forms.TreeViewCancelEventHandler " />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Forms.TreeViewCancelEventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs before the tree node check box is checked.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
> [!NOTE]
> Setting the <xref:System.Windows.Forms.TreeNode.Checked%2A?displayProperty=nameWithType> property from within the <xref:System.Windows.Forms.TreeView.BeforeCheck> or <xref:System.Windows.Forms.TreeView.AfterCheck> event causes the event to be raised multiple times and can result in unexpected behavior. For example, you might set the <xref:System.Windows.Forms.TreeNode.Checked%2A> property in the event handler when you are recursively updating the child nodes, so that the user does not have to expand and check each one individually. To prevent the event from being raised multiple times, add logic to your event handler that only executes your recursive code if the <xref:System.Windows.Forms.TreeViewEventArgs.Action%2A> property of the <xref:System.Windows.Forms.TreeViewEventArgs> is not set to <xref:System.Windows.Forms.TreeViewAction.Unknown?displayProperty=nameWithType>.
For more information about how to handle events, see [Handling and Raising Events](~/docs/standard/events/index.md).
## Examples
The following code example updates all the child tree nodes of a <xref:System.Windows.Forms.TreeNode> when the user changes its checked state. This code requires that you have a <xref:System.Windows.Forms.Form> with a <xref:System.Windows.Forms.TreeView> that has <xref:System.Windows.Forms.TreeNode> objects in its <xref:System.Windows.Forms.TreeNodeCollection>. The <xref:System.Windows.Forms.TreeNodeCollection> should have tree nodes with child nodes.
[!code-cpp[TreeView.AfterCheck_BeforeCheck#1](~/samples/snippets/cpp/VS_Snippets_Winforms/TreeView.AfterCheck_BeforeCheck/CPP/tn_checked.cpp#1)]
[!code-csharp[TreeView.AfterCheck_BeforeCheck#1](~/samples/snippets/csharp/VS_Snippets_Winforms/TreeView.AfterCheck_BeforeCheck/CS/tn_checked.cs#1)]
[!code-vb[TreeView.AfterCheck_BeforeCheck#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/TreeView.AfterCheck_BeforeCheck/VB/tn_checked.vb#1)]
]]></format>
</remarks>
<altmember cref="P:System.Windows.Forms.TreeView.CheckBoxes" />
<altmember cref="M:System.Windows.Forms.TreeView.OnBeforeCheck(System.Windows.Forms.TreeViewCancelEventArgs)" />
<altmember cref="E:System.Windows.Forms.TreeView.AfterCheck" />
<altmember cref="M:System.Windows.Forms.TreeView.OnAfterCheck(System.Windows.Forms.TreeViewEventArgs)" />
</Docs>
</Member>
<Member MemberName="BeforeCollapse">
<MemberSignature Language="C#" Value="public event System.Windows.Forms.TreeViewCancelEventHandler BeforeCollapse;" />
<MemberSignature Language="ILAsm" Value=".event class System.Windows.Forms.TreeViewCancelEventHandler BeforeCollapse" />
<MemberSignature Language="DocId" Value="E:System.Windows.Forms.TreeView.BeforeCollapse" />
<MemberSignature Language="VB.NET" Value="Public Custom Event BeforeCollapse As TreeViewCancelEventHandler " />
<MemberSignature Language="C++ CLI" Value="public:&#xA; event System::Windows::Forms::TreeViewCancelEventHandler ^ BeforeCollapse;" />
<MemberSignature Language="F#" Value="member this.BeforeCollapse : System.Windows.Forms.TreeViewCancelEventHandler " Usage="member this.BeforeCollapse : System.Windows.Forms.TreeViewCancelEventHandler " />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Forms.TreeViewCancelEventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs before the tree node is collapsed.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
For more information about how to handle events, see [Handling and Raising Events](~/docs/standard/events/index.md).
## Examples
The following code example demonstrates how to change the collapse state of a <xref:System.Windows.Forms.TreeView> so that all the checked nodes are visible. First, all the nodes are expanded, and a handler is added for the <xref:System.Windows.Forms.TreeView.BeforeCollapse> event. Next, all the nodes are collapsed. The <xref:System.Windows.Forms.TreeView.BeforeCollapse> event handler determines whether a given node has child nodes that are checked. If a node has checked children, the collapse is canceled for that node. In order to allow standard node collapse when the minus sign next to a node is clicked, the <xref:System.Windows.Forms.TreeView.BeforeCollapse> event handler is then removed.
This behavior can also be implemented by handling the <xref:System.Windows.Forms.TreeView.BeforeExpand> event, as illustrated in the example for that topic.
For the complete example, see the <xref:System.Windows.Forms.TreeView.%23ctor%2A> constructor reference topic.
[!code-cpp[TreeViewShowCheckedNodes2#2](~/samples/snippets/cpp/VS_Snippets_Winforms/TreeViewShowCheckedNodes2/CPP/treeviewshowcheckednodes2.cpp#2)]
[!code-csharp[TreeViewShowCheckedNodes2#2](~/samples/snippets/csharp/VS_Snippets_Winforms/TreeViewShowCheckedNodes2/CS/treeviewshowcheckednodes2.cs#2)]
[!code-vb[TreeViewShowCheckedNodes2#2](~/samples/snippets/visualbasic/VS_Snippets_Winforms/TreeViewShowCheckedNodes2/VB/treeviewshowcheckednodes2.vb#2)]
]]></format>
</remarks>
<altmember cref="M:System.Windows.Forms.TreeView.OnBeforeCollapse(System.Windows.Forms.TreeViewCancelEventArgs)" />
<altmember cref="E:System.Windows.Forms.TreeView.AfterCollapse" />
<altmember cref="M:System.Windows.Forms.TreeView.OnAfterCollapse(System.Windows.Forms.TreeViewEventArgs)" />
</Docs>
</Member>
<Member MemberName="BeforeExpand">
<MemberSignature Language="C#" Value="public event System.Windows.Forms.TreeViewCancelEventHandler BeforeExpand;" />
<MemberSignature Language="ILAsm" Value=".event class System.Windows.Forms.TreeViewCancelEventHandler BeforeExpand" />
<MemberSignature Language="DocId" Value="E:System.Windows.Forms.TreeView.BeforeExpand" />
<MemberSignature Language="VB.NET" Value="Public Custom Event BeforeExpand As TreeViewCancelEventHandler " />
<MemberSignature Language="C++ CLI" Value="public:&#xA; event System::Windows::Forms::TreeViewCancelEventHandler ^ BeforeExpand;" />
<MemberSignature Language="F#" Value="member this.BeforeExpand : System.Windows.Forms.TreeViewCancelEventHandler " Usage="member this.BeforeExpand : System.Windows.Forms.TreeViewCancelEventHandler " />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Forms.TreeViewCancelEventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs before the tree node is expanded.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
For more information about how to handle events, see [Handling and Raising Events](~/docs/standard/events/index.md).
## Examples
The following code example demonstrates how to change the collapse state of a <xref:System.Windows.Forms.TreeView> so that all the checked nodes are visible. First, all the nodes are collapsed, and a handler is added for the <xref:System.Windows.Forms.TreeView.BeforeExpand> event. Next, all the nodes are expanded. The <xref:System.Windows.Forms.TreeView.BeforeExpand> event handler determines whether a given node has child nodes that are checked. If a node does not have checked children, the expansion is canceled for that node. In order to allow standard node expansion when the plus sign next to a node is clicked, the <xref:System.Windows.Forms.TreeView.BeforeExpand> event handler is then removed.
This behavior can also be implemented by handling the <xref:System.Windows.Forms.TreeView.BeforeCollapse> event, as illustrated in the example for that topic.
For the complete example, see the <xref:System.Windows.Forms.TreeView.CheckBoxes%2A> reference topic.
[!code-cpp[TreeViewShowCheckedNodes1#2](~/samples/snippets/cpp/VS_Snippets_Winforms/TreeViewShowCheckedNodes1/CPP/treeviewshowcheckednodes1.cpp#2)]
[!code-csharp[TreeViewShowCheckedNodes1#2](~/samples/snippets/csharp/VS_Snippets_Winforms/TreeViewShowCheckedNodes1/CS/treeviewshowcheckednodes1.cs#2)]
[!code-vb[TreeViewShowCheckedNodes1#2](~/samples/snippets/visualbasic/VS_Snippets_Winforms/TreeViewShowCheckedNodes1/VB/treeviewshowcheckednodes1.vb#2)]
]]></format>
</remarks>
<altmember cref="M:System.Windows.Forms.TreeView.OnBeforeExpand(System.Windows.Forms.TreeViewCancelEventArgs)" />
<altmember cref="E:System.Windows.Forms.TreeView.AfterExpand" />
<altmember cref="M:System.Windows.Forms.TreeView.OnAfterExpand(System.Windows.Forms.TreeViewEventArgs)" />
</Docs>
</Member>
<Member MemberName="BeforeLabelEdit">
<MemberSignature Language="C#" Value="public event System.Windows.Forms.NodeLabelEditEventHandler BeforeLabelEdit;" />
<MemberSignature Language="ILAsm" Value=".event class System.Windows.Forms.NodeLabelEditEventHandler BeforeLabelEdit" />
<MemberSignature Language="DocId" Value="E:System.Windows.Forms.TreeView.BeforeLabelEdit" />
<MemberSignature Language="VB.NET" Value="Public Custom Event BeforeLabelEdit As NodeLabelEditEventHandler " />
<MemberSignature Language="C++ CLI" Value="public:&#xA; event System::Windows::Forms::NodeLabelEditEventHandler ^ BeforeLabelEdit;" />
<MemberSignature Language="F#" Value="member this.BeforeLabelEdit : System.Windows.Forms.NodeLabelEditEventHandler " Usage="member this.BeforeLabelEdit : System.Windows.Forms.NodeLabelEditEventHandler " />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Forms.NodeLabelEditEventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs before the tree node label text is edited.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
For more information about how to handle events, see [Handling and Raising Events](~/docs/standard/events/index.md).
## Examples
The following code example demonstrates how to use the <xref:System.Windows.Forms.TreeView.BeforeLabelEdit><xref:System.Windows.Forms.TreeView.AfterSelect> and <xref:System.Windows.Forms.TreeView.TopNode%2A> members. To run this example, paste the following code in a form that contains a `TreeView` control that is named `TreeView1`. Call the `InitializeTreeView` method in the form's constructor or `Load` method.
[!code-cpp[System.Windows.Forms.TreeViewAndPrintPreview#1](~/samples/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.TreeViewAndPrintPreview/CPP/form1.cpp#1)]
[!code-csharp[System.Windows.Forms.TreeViewAndPrintPreview#1](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.TreeViewAndPrintPreview/CS/form1.cs#1)]
[!code-vb[System.Windows.Forms.TreeViewAndPrintPreview#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TreeViewAndPrintPreview/VB/form1.vb#1)]
[!code-cpp[System.Windows.Forms.TreeViewAndPrintPreview#2](~/samples/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.TreeViewAndPrintPreview/CPP/form1.cpp#2)]
[!code-csharp[System.Windows.Forms.TreeViewAndPrintPreview#2](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.TreeViewAndPrintPreview/CS/form1.cs#2)]
[!code-vb[System.Windows.Forms.TreeViewAndPrintPreview#2](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TreeViewAndPrintPreview/VB/form1.vb#2)]
]]></format>
</remarks>
<altmember cref="M:System.Windows.Forms.TreeView.OnBeforeLabelEdit(System.Windows.Forms.NodeLabelEditEventArgs)" />
<altmember cref="E:System.Windows.Forms.TreeView.AfterLabelEdit" />
<altmember cref="M:System.Windows.Forms.TreeView.OnAfterLabelEdit(System.Windows.Forms.NodeLabelEditEventArgs)" />
</Docs>
</Member>
<Member MemberName="BeforeSelect">
<MemberSignature Language="C#" Value="public event System.Windows.Forms.TreeViewCancelEventHandler BeforeSelect;" />
<MemberSignature Language="ILAsm" Value=".event class System.Windows.Forms.TreeViewCancelEventHandler BeforeSelect" />
<MemberSignature Language="DocId" Value="E:System.Windows.Forms.TreeView.BeforeSelect" />
<MemberSignature Language="VB.NET" Value="Public Custom Event BeforeSelect As TreeViewCancelEventHandler " />
<MemberSignature Language="C++ CLI" Value="public:&#xA; event System::Windows::Forms::TreeViewCancelEventHandler ^ BeforeSelect;" />
<MemberSignature Language="F#" Value="member this.BeforeSelect : System.Windows.Forms.TreeViewCancelEventHandler " Usage="member this.BeforeSelect : System.Windows.Forms.TreeViewCancelEventHandler " />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Forms.TreeViewCancelEventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs before the tree node is selected.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
For more information about how to handle events, see [Handling and Raising Events](~/docs/standard/events/index.md).
## Examples
The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.TreeView.BeforeSelect> event. This report helps you learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>.
To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.TreeView> named `TreeView1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.TreeView.BeforeSelect> event.
[!code-csharp[System.Windows.Forms.EventExamples#635](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/CS/EventExamples.cs#635)]
[!code-vb[System.Windows.Forms.EventExamples#635](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb#635)]
]]></format>
</remarks>
<altmember cref="M:System.Windows.Forms.TreeView.OnBeforeSelect(System.Windows.Forms.TreeViewCancelEventArgs)" />
<altmember cref="E:System.Windows.Forms.TreeView.AfterSelect" />
<altmember cref="M:System.Windows.Forms.TreeView.OnAfterSelect(System.Windows.Forms.TreeViewEventArgs)" />
</Docs>
</Member>
<Member MemberName="BeginUpdate">
<MemberSignature Language="C#" Value="public void BeginUpdate ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void BeginUpdate() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.TreeView.BeginUpdate" />
<MemberSignature Language="VB.NET" Value="Public Sub BeginUpdate ()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void BeginUpdate();" />
<MemberSignature Language="F#" Value="member this.BeginUpdate : unit -&gt; unit" Usage="treeView.BeginUpdate " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Disables any redrawing of the tree view.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
To maintain performance while items are added one at a time to the <xref:System.Windows.Forms.TreeView>, call the <xref:System.Windows.Forms.TreeView.BeginUpdate%2A> method. The <xref:System.Windows.Forms.TreeView.BeginUpdate%2A> method prevents the control from painting until the <xref:System.Windows.Forms.TreeView.EndUpdate%2A> method is called.
The preferred way to add items to a tree view control is to use the <xref:System.Windows.Forms.TreeNodeCollection.AddRange%2A> method to add an array of tree node items to a tree view. However, if you want to add items one at a time, use the <xref:System.Windows.Forms.TreeView.BeginUpdate%2A> method to prevent the <xref:System.Windows.Forms.TreeView> control from painting during the add operations. To allow the control to resume painting, call the <xref:System.Windows.Forms.TreeView.EndUpdate%2A> method when all the tree nodes have been added to the tree view.
## Examples
The following code example displays customer information in a <xref:System.Windows.Forms.TreeView> control. The root tree nodes display customer names, and the child tree nodes display the order numbers assigned to each customer. In this example, 1,000 customers are displayed with 15 orders each. The repainting of the <xref:System.Windows.Forms.TreeView> is suppressed by using the <xref:System.Windows.Forms.TreeView.BeginUpdate%2A> and <xref:System.Windows.Forms.TreeView.EndUpdate%2A> methods, and a wait <xref:System.Windows.Forms.Cursor> is displayed while the <xref:System.Windows.Forms.TreeView> creates and paints the <xref:System.Windows.Forms.TreeNode> objects. This example requires that you have a `Customer` object that can hold a collection of `Order` objects. It also requires that you have a cursor file that is named `MyWait.cur` in the application directory and that you have created an instance of a <xref:System.Windows.Forms.TreeView> control on a <xref:System.Windows.Forms.Form>.
[!code-cpp[TreeView#1](~/samples/snippets/cpp/VS_Snippets_Winforms/TreeView/CPP/treeview.cpp#1)]
[!code-csharp[TreeView#1](~/samples/snippets/csharp/VS_Snippets_Winforms/TreeView/CS/treeview.cs#1)]
[!code-vb[TreeView#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/TreeView/VB/treeview.vb#1)]
]]></format>
</remarks>
<altmember cref="M:System.Windows.Forms.TreeView.EndUpdate" />
</Docs>
</Member>
<Member MemberName="BorderStyle">
<MemberSignature Language="C#" Value="public System.Windows.Forms.BorderStyle BorderStyle { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Windows.Forms.BorderStyle BorderStyle" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.TreeView.BorderStyle" />
<MemberSignature Language="VB.NET" Value="Public Property BorderStyle As BorderStyle" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Windows::Forms::BorderStyle BorderStyle { System::Windows::Forms::BorderStyle get(); void set(System::Windows::Forms::BorderStyle value); };" />
<MemberSignature Language="F#" Value="member this.BorderStyle : System.Windows.Forms.BorderStyle with get, set" Usage="System.Windows.Forms.TreeView.BorderStyle" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(Mono.Cecil.CustomAttributeArgument)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Runtime.InteropServices.DispId(-504)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Windows.Forms.BorderStyle</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the border style of the tree view control.</summary>
<value>One of the <see cref="T:System.Windows.Forms.BorderStyle" /> values. The default is <see cref="F:System.Windows.Forms.BorderStyle.Fixed3D" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
When the <xref:System.Windows.Forms.TreeView.BorderStyle%2A> property is set to <xref:System.Windows.Forms.BorderStyle.Fixed3D>, the <xref:System.Windows.Forms.TreeView> has a sunken, three-dimensional appearance. To display a flat, thin border around the <xref:System.Windows.Forms.TreeView> control, set the <xref:System.Windows.Forms.BorderStyle> property to <xref:System.Windows.Forms.BorderStyle.FixedSingle>.
## Examples
The following code example demonstrates how to use the <xref:System.Windows.Forms.BorderStyle> enumeration and the <xref:System.Windows.Forms.TreeView.BorderStyle%2A>, <xref:System.Windows.Forms.TreeView.ShowLines%2A>, <xref:System.Windows.Forms.TreeView.Scrollable%2A>, <xref:System.Windows.Forms.TreeView.HideSelection%2A> and <xref:System.Windows.Forms.TreeView.ShowRootLines%2A> properties. To run this example, paste the following code in a form and call the `InitializeTreeView` method in the form's constructor or `Load` method.
[!code-cpp[System.Windows.Forms.TreeViewExample#1](~/samples/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.TreeViewExample/CPP/form1.cpp#1)]
[!code-csharp[System.Windows.Forms.TreeViewExample#1](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.TreeViewExample/CS/form1.cs#1)]
[!code-vb[System.Windows.Forms.TreeViewExample#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TreeViewExample/VB/form1.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.ComponentModel.InvalidEnumArgumentException">The assigned value is not one of the <see cref="T:System.Windows.Forms.BorderStyle" /> values.</exception>
<altmember cref="T:System.Windows.Forms.BorderStyle" />
</Docs>
</Member>
<Member MemberName="CheckBoxes">
<MemberSignature Language="C#" Value="public bool CheckBoxes { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool CheckBoxes" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.TreeView.CheckBoxes" />
<MemberSignature Language="VB.NET" Value="Public Property CheckBoxes As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property bool CheckBoxes { bool get(); void set(bool value); };" />
<MemberSignature Language="F#" Value="member this.CheckBoxes : bool with get, set" Usage="System.Windows.Forms.TreeView.CheckBoxes" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value indicating whether check boxes are displayed next to the tree nodes in the tree view control.</summary>
<value>
<see langword="true" /> if a check box is displayed next to each tree node in the tree view control; otherwise, <see langword="false" />. The default is <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
A check box is displayed to the left of both the tree node label and tree node <xref:System.Drawing.Image>, if any. Check boxes allow the user to select more than one tree node at a time.
When the <xref:System.Windows.Forms.TreeView.CheckBoxes%2A> property of a <xref:System.Windows.Forms.TreeView> is set to `true`, and the <xref:System.Windows.Forms.TreeView.StateImageList%2A> property is set, each <xref:System.Windows.Forms.TreeNode> that is contained in the <xref:System.Windows.Forms.TreeView> displays the first and second images from the <xref:System.Windows.Forms.TreeView.StateImageList%2A> to indicate an unchecked or checked state, respectively. However, the displayed images may be different if the following situation occurs: If the <xref:System.Windows.Forms.TreeView.SelectedImageIndex%2A> of the node is set to a value other than 0 or 1, and the <xref:System.Windows.Forms.TreeView.CheckBoxes%2A> property of the parent <xref:System.Windows.Forms.TreeView> is set to `false`, the <xref:System.Windows.Forms.TreeView.SelectedImageIndex%2A> 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 <xref:System.Windows.Forms.TreeView.CheckBoxes%2A> is set to `true` again, the first and second images of the <xref:System.Windows.Forms.TreeView.StateImageList%2A> are shown to indicate a checked or unchecked state, respectively.
> [!NOTE]
> When setting the <xref:System.Windows.Forms.TreeView.CheckBoxes%2A> property at run time, the <xref:System.Windows.Forms.TreeView> handle is recreated (see <xref:System.Windows.Forms.Control.RecreateHandle%2A?displayProperty=nameWithType>) to update the control's appearance. This causes all tree nodes to be collapsed, with the exception of the selected <xref:System.Windows.Forms.TreeNode>.
## Examples
The following code example demonstrates how to change the collapse state of a <xref:System.Windows.Forms.TreeView> so that all the checked nodes are visible. First, all the nodes are collapsed, and a handler is added for the <xref:System.Windows.Forms.TreeView.BeforeExpand> event. Next, all the nodes are expanded. The <xref:System.Windows.Forms.TreeView.BeforeExpand> event handler determines whether a given node has child nodes that are checked. If a node does not have checked children, the expansion is canceled for that node. In order to allow standard node expansion when the plus sign next to a node is clicked, the <xref:System.Windows.Forms.TreeView.BeforeExpand> event handler is then removed.
This behavior can also be implemented by handling the <xref:System.Windows.Forms.TreeView.BeforeCollapse> event, as illustrated in the example for that topic.
[!code-cpp[TreeViewShowCheckedNodes1#1](~/samples/snippets/cpp/VS_Snippets_Winforms/TreeViewShowCheckedNodes1/CPP/treeviewshowcheckednodes1.cpp#1)]
[!code-csharp[TreeViewShowCheckedNodes1#1](~/samples/snippets/csharp/VS_Snippets_Winforms/TreeViewShowCheckedNodes1/CS/treeviewshowcheckednodes1.cs#1)]
[!code-vb[TreeViewShowCheckedNodes1#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/TreeViewShowCheckedNodes1/VB/treeviewshowcheckednodes1.vb#1)]
]]></format>
</remarks>
<altmember cref="P:System.Windows.Forms.TreeNode.Checked" />
</Docs>
</Member>
<Member MemberName="CollapseAll">
<MemberSignature Language="C#" Value="public void CollapseAll ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void CollapseAll() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.TreeView.CollapseAll" />
<MemberSignature Language="VB.NET" Value="Public Sub CollapseAll ()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void CollapseAll();" />
<MemberSignature Language="F#" Value="member this.CollapseAll : unit -&gt; unit" Usage="treeView.CollapseAll " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Collapses all the tree nodes.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.TreeView.CollapseAll%2A> method collapses all the <xref:System.Windows.Forms.TreeNode> objects, which includes all the child tree nodes, that are in the <xref:System.Windows.Forms.TreeView> control.
> [!NOTE]
> The state of a <xref:System.Windows.Forms.TreeNode> persists. For example, suppose that you call the <xref:System.Windows.Forms.TreeNode.Expand%2A> method for a root tree node. If the child tree nodes were not previously collapsed, they will appear in their previously-expanded state. Calling the <xref:System.Windows.Forms.TreeView.CollapseAll%2A> method ensures that all the tree nodes appear in the collapsed state.
## Examples
The following code example demonstrates how to change the collapse state of a <xref:System.Windows.Forms.TreeView> so that all the checked nodes are visible. First, all the nodes are collapsed, and a handler is added for the <xref:System.Windows.Forms.TreeView.BeforeExpand> event. Next, all the nodes are expanded. The <xref:System.Windows.Forms.TreeView.BeforeExpand> event handler determines whether a given node has child nodes that are checked. If a node does not have checked children, the expansion is canceled for that node. In order to allow standard node expansion when the plus sign next to a node is clicked, the <xref:System.Windows.Forms.TreeView.BeforeExpand> event handler is then removed.
This behavior can also be implemented by handling the <xref:System.Windows.Forms.TreeView.BeforeCollapse> event, as illustrated in the example for that topic.
For the complete example, see the <xref:System.Windows.Forms.TreeView.CheckBoxes%2A> reference topic.
[!code-cpp[TreeViewShowCheckedNodes1#2](~/samples/snippets/cpp/VS_Snippets_Winforms/TreeViewShowCheckedNodes1/CPP/treeviewshowcheckednodes1.cpp#2)]
[!code-csharp[TreeViewShowCheckedNodes1#2](~/samples/snippets/csharp/VS_Snippets_Winforms/TreeViewShowCheckedNodes1/CS/treeviewshowcheckednodes1.cs#2)]
[!code-vb[TreeViewShowCheckedNodes1#2](~/samples/snippets/visualbasic/VS_Snippets_Winforms/TreeViewShowCheckedNodes1/VB/treeviewshowcheckednodes1.vb#2)]
]]></format>
</remarks>
<altmember cref="M:System.Windows.Forms.TreeNode.Collapse" />
<altmember cref="M:System.Windows.Forms.TreeView.ExpandAll" />
</Docs>
</Member>
<Member MemberName="CreateHandle">
<MemberSignature Language="C#" Value="protected override void CreateHandle ();" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void CreateHandle() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.TreeView.CreateHandle" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Sub CreateHandle ()" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; override void CreateHandle();" />
<MemberSignature Language="F#" Value="override this.CreateHandle : unit -&gt; unit" Usage="treeView.CreateHandle " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Creates a handle for the control.</summary>
<remarks>To be added.</remarks>
<altmember cref="M:System.Windows.Forms.Control.CreateHandle" />
</Docs>
</Member>
<Member MemberName="CreateParams">
<MemberSignature Language="C#" Value="protected override System.Windows.Forms.CreateParams CreateParams { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Windows.Forms.CreateParams CreateParams" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.TreeView.CreateParams" />
<MemberSignature Language="VB.NET" Value="Protected Overrides ReadOnly Property CreateParams As CreateParams" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual property System::Windows::Forms::CreateParams ^ CreateParams { System::Windows::Forms::CreateParams ^ get(); };" />
<MemberSignature Language="F#" Value="member this.CreateParams : System.Windows.Forms.CreateParams" Usage="System.Windows.Forms.TreeView.CreateParams" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Forms.CreateParams</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the required creation parameters when the control handle is created.</summary>
<value>The creation parameters.</value>
<remarks>To be added.</remarks>
<permission cref="T:System.Security.Permissions.SecurityPermissionFlag">for access to unmanaged code when getting the property value. Associated enumeration: <see cref="F:System.Security.Permissions.SecurityPermissionFlag.UnmanagedCode" /></permission>
</Docs>
</Member>
<Member MemberName="DefaultSize">
<MemberSignature Language="C#" Value="protected override System.Drawing.Size DefaultSize { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Drawing.Size DefaultSize" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.TreeView.DefaultSize" />
<MemberSignature Language="VB.NET" Value="Protected Overrides ReadOnly Property DefaultSize As Size" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual property System::Drawing::Size DefaultSize { System::Drawing::Size get(); };" />
<MemberSignature Language="F#" Value="member this.DefaultSize : System.Drawing.Size" Usage="System.Windows.Forms.TreeView.DefaultSize" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Drawing.Size</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the default size of the control.</summary>
<value>The default <see cref="T:System.Drawing.Size" /> of the control.</value>
<remarks>To be added.</remarks>
<altmember cref="P:System.Windows.Forms.Control.DefaultSize" />
</Docs>
</Member>
<Member MemberName="Dispose">
<MemberSignature Language="C#" Value="protected override void Dispose (bool disposing);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void Dispose(bool disposing) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.TreeView.Dispose(System.Boolean)" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Sub Dispose (disposing As Boolean)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; override void Dispose(bool disposing);" />
<MemberSignature Language="F#" Value="override this.Dispose : bool -&gt; unit" Usage="treeView.Dispose disposing" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="disposing" Type="System.Boolean" />
</Parameters>
<Docs>
<param name="disposing">
<see langword="true" /> to release both managed and unmanaged resources; <see langword="false" /> to release only unmanaged resources.</param>
<summary>Releases the unmanaged resources used by the <see cref="T:System.Windows.Forms.TreeView" /> and optionally releases the managed resources.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method is called by the public `Dispose` method and the <xref:System.Object.Finalize%2A> method. `Dispose` invokes the protected `Dispose(Boolean)` method with the `disposing` parameter set to `true`. <xref:System.Object.Finalize%2A> invokes `Dispose` with `disposing` set to `false`.
When the `disposing` parameter is true, this method releases all resources held by any managed objects that this <xref:System.Windows.Forms.TreeView> references. This method invokes the `Dispose` method of each referenced object.
]]></format>
</remarks>
<block subset="none" type="overrides">
<para>
<see langword="Dispose" /> can be called multiple times by other objects. When overriding <see langword="Dispose(Boolean)" /> be careful not to reference objects that have been previously disposed of in an earlier call to <see langword="Dispose" />. For more information about how to implement <see langword="Dispose(Boolean)" />, see [Implementing a Dispose Method](~/docs/standard/garbage-collection/implementing-dispose.md).
For more information about <see langword="Dispose" /> and <see cref="M:System.Object.Finalize" />, see [Cleaning Up Unmanaged Resources](~/docs/standard/garbage-collection/unmanaged.md) and [Overriding the Finalize Method](https://docs.microsoft.com/previous-versions/dotnet/netframework-4.0/ddae83kx(v=vs.100)).</para>
</block>
</Docs>
</Member>
<Member MemberName="DoubleBuffered">
<MemberSignature Language="C#" Value="protected override bool DoubleBuffered { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool DoubleBuffered" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.TreeView.DoubleBuffered" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Property DoubleBuffered As Boolean" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual property bool DoubleBuffered { bool get(); void set(bool value); };" />
<MemberSignature Language="F#" Value="member this.DoubleBuffered : bool with get, set" Usage="System.Windows.Forms.TreeView.DoubleBuffered" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netcore-3.0">
<AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value indicating whether the control should redraw its surface using a secondary buffer. The <see cref="P:System.Windows.Forms.TreeView.DoubleBuffered" /> property does not affect the <see cref="T:System.Windows.Forms.TreeView" /> control.</summary>
<value>
<see langword="true" /> if the control uses a secondary buffer; otherwise, <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Setting the <xref:System.Windows.Forms.TreeView.DoubleBuffered%2A> property does not affect the <xref:System.Windows.Forms.TreeView> control. If you want to reduce flicker when the <xref:System.Windows.Forms.TreeView> is drawn, use the <xref:System.Windows.Forms.TreeView.BeginUpdate%2A> and <xref:System.Windows.Forms.TreeView.EndUpdate%2A> methods.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="DrawMode">
<MemberSignature Language="C#" Value="public System.Windows.Forms.TreeViewDrawMode DrawMode { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Windows.Forms.TreeViewDrawMode DrawMode" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.TreeView.DrawMode" />
<MemberSignature Language="VB.NET" Value="Public Property DrawMode As TreeViewDrawMode" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Windows::Forms::TreeViewDrawMode DrawMode { System::Windows::Forms::TreeViewDrawMode get(); void set(System::Windows::Forms::TreeViewDrawMode value); };" />
<MemberSignature Language="F#" Value="member this.DrawMode : System.Windows.Forms.TreeViewDrawMode with get, set" Usage="System.Windows.Forms.TreeView.DrawMode" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netcore-3.0">
<AttributeName>System.ComponentModel.DefaultValue(Mono.Cecil.CustomAttributeArgument)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Windows.Forms.TreeViewDrawMode</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the mode in which the control is drawn.</summary>
<value>One of the <see cref="T:System.Windows.Forms.TreeViewDrawMode" /> values. The default is <see cref="F:System.Windows.Forms.TreeViewDrawMode.Normal" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The nodes of a <xref:System.Windows.Forms.TreeView> are typically drawn by the operating system. The <xref:System.Windows.Forms.TreeView.DrawMode%2A> property lets you customize the appearance of the nodes. To do this, set <xref:System.Windows.Forms.TreeView.DrawMode%2A> to <xref:System.Windows.Forms.TreeViewDrawMode.OwnerDrawAll?displayProperty=nameWithType> or <xref:System.Windows.Forms.TreeViewDrawMode.OwnerDrawText?displayProperty=nameWithType> and provide a handler for the <xref:System.Windows.Forms.TreeView.DrawNode> event. This is called owner drawing.
## Examples
The following code example demonstrates how to customize a <xref:System.Windows.Forms.TreeView> control using owner drawing. The <xref:System.Windows.Forms.TreeView> control in the example displays optional node tags alongside the standard node labels. Node tags are specified by using the <xref:System.Windows.Forms.TreeNode.Tag%2A?displayProperty=nameWithType> property. The <xref:System.Windows.Forms.TreeView> control also uses custom colors, which include a custom highlight color.
You can customize most of the <xref:System.Windows.Forms.TreeView> colors by setting color properties, but the selection highlight color is not available as a property. Additionally, the default selection highlight rectangle extends only around a node label. Owner drawing must be used to draw the node tags and to draw a customized highlight rectangle large enough to include a node tag.
For the complete example, see the <xref:System.Windows.Forms.TreeView.DrawNode> reference topic.
[!code-cpp[TreeViewOwnerDraw#2](~/samples/snippets/cpp/VS_Snippets_Winforms/TreeViewOwnerDraw/CPP/treeviewownerdraw.cpp#2)]
[!code-csharp[TreeViewOwnerDraw#2](~/samples/snippets/csharp/VS_Snippets_Winforms/TreeViewOwnerDraw/CS/treeviewownerdraw.cs#2)]
[!code-vb[TreeViewOwnerDraw#2](~/samples/snippets/visualbasic/VS_Snippets_Winforms/TreeViewOwnerDraw/VB/treeviewownerdraw.vb#2)]
]]></format>
</remarks>
<exception cref="T:System.ComponentModel.InvalidEnumArgumentException">The property value is not a valid <see cref="T:System.Windows.Forms.TreeViewDrawMode" /> value.</exception>
<altmember cref="T:System.Windows.Forms.TreeViewDrawMode" />
<altmember cref="E:System.Windows.Forms.TreeView.DrawNode" />
</Docs>
</Member>
<Member MemberName="DrawNode">
<MemberSignature Language="C#" Value="public event System.Windows.Forms.DrawTreeNodeEventHandler DrawNode;" />
<MemberSignature Language="ILAsm" Value=".event class System.Windows.Forms.DrawTreeNodeEventHandler DrawNode" />
<MemberSignature Language="DocId" Value="E:System.Windows.Forms.TreeView.DrawNode" />
<MemberSignature Language="VB.NET" Value="Public Custom Event DrawNode As DrawTreeNodeEventHandler " />
<MemberSignature Language="C++ CLI" Value="public:&#xA; event System::Windows::Forms::DrawTreeNodeEventHandler ^ DrawNode;" />
<MemberSignature Language="F#" Value="member this.DrawNode : System.Windows.Forms.DrawTreeNodeEventHandler " Usage="member this.DrawNode : System.Windows.Forms.DrawTreeNodeEventHandler " />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Forms.DrawTreeNodeEventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs when a <see cref="T:System.Windows.Forms.TreeView" /> is drawn and the <see cref="P:System.Windows.Forms.TreeView.DrawMode" /> property is set to a <see cref="T:System.Windows.Forms.TreeViewDrawMode" /> value other than <see cref="F:System.Windows.Forms.TreeViewDrawMode.Normal" />.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use this event to customize the appearance of nodes in a <xref:System.Windows.Forms.TreeView> control using owner drawing.
This event is raised only when the <xref:System.Windows.Forms.TreeView.DrawMode%2A> property is set to <xref:System.Windows.Forms.TreeViewDrawMode> values of <xref:System.Windows.Forms.TreeViewDrawMode.OwnerDrawAll> or <xref:System.Windows.Forms.TreeViewDrawMode.OwnerDrawText>. The following table indicates how the <xref:System.Windows.Forms.TreeNode> can be customized when the <xref:System.Windows.Forms.TreeView.DrawMode%2A> property is set to these values.
|DrawMode property value|TreeNode customization|
|-----------------------------|----------------------------|
|<xref:System.Windows.Forms.TreeViewDrawMode.OwnerDrawText>|The <xref:System.Windows.Forms.TreeNode> label area can be customized. All other <xref:System.Windows.Forms.TreeNode> elements are drawn automatically.|
|<xref:System.Windows.Forms.TreeViewDrawMode.OwnerDrawAll>|The appearance of the entire <xref:System.Windows.Forms.TreeNode> can be customized. Icons, check boxes, plus and minus signs, and lines connecting the nodes must be drawn manually if they are desired.|
The region that the <xref:System.Windows.Forms.TreeNode.Text%2A?displayProperty=nameWithType> value would occupy if it were drawn using the font specified by the <xref:System.Windows.Forms.TreeView> control's <xref:System.Windows.Forms.Control.Font%2A> property is the region in which a node can be clicked to select it. This is called the hit test region. If you draw outside this region, you should provide your own code that selects a node when its visible area is clicked.
The hit test region corresponds to the <xref:System.Windows.Forms.DrawTreeNodeEventArgs.Bounds%2A?displayProperty=nameWithType> property when using <xref:System.Windows.Forms.TreeViewDrawMode.OwnerDrawText>. When using <xref:System.Windows.Forms.TreeViewDrawMode.OwnerDrawAll>, however, the <xref:System.Windows.Forms.DrawTreeNodeEventArgs.Bounds%2A?displayProperty=nameWithType> property encompasses the entire width of the <xref:System.Windows.Forms.TreeView>. In this case, you can access the hit test region by getting the <xref:System.Windows.Forms.DrawTreeNodeEventArgs.Node%2A?displayProperty=nameWithType> value and accessing its <xref:System.Windows.Forms.TreeNode.Bounds%2A?displayProperty=nameWithType> property. You can then draw the hit test region of the node within these bounds, or you can provide your own hit test code. Note that setting the <xref:System.Windows.Forms.TreeNode.NodeFont%2A?displayProperty=nameWithType> property does not change the size of the hit test region, which is calculated using the font specified for the entire <xref:System.Windows.Forms.TreeView>.
For more information about how to handle events, see [Handling and Raising Events](~/docs/standard/events/index.md).
## Examples
The following code example demonstrates how to customize a <xref:System.Windows.Forms.TreeView> control using owner drawing. The <xref:System.Windows.Forms.TreeView> control in the example displays optional node tags alongside the standard node labels. Node tags are specified by using the <xref:System.Windows.Forms.TreeNode.Tag%2A?displayProperty=nameWithType> property. The <xref:System.Windows.Forms.TreeView> control also uses custom colors, which include a custom highlight color.
You can customize most of the <xref:System.Windows.Forms.TreeView> colors by setting color properties, but the selection highlight color is not available as a property. Additionally, the default selection highlight rectangle extends only around a node label. Owner drawing must be used to draw the node tags and to draw a customized highlight rectangle large enough to include a node tag.
In the example, a handler for the <xref:System.Windows.Forms.TreeView.DrawNode> event draws the node tags and the custom selection highlight manually. Unselected nodes do not need customization. For these, the <xref:System.Windows.Forms.DrawTreeNodeEventArgs.DrawDefault%2A?displayProperty=nameWithType> property is set to `true` so that they will be drawn by the operating system.
Additionally, a handler for the <xref:System.Windows.Forms.Control.MouseDown> event provides hit-testing. By default, a node can be selected only by clicking the region around its label. The <xref:System.Windows.Forms.Control.MouseDown> event handler selects a node that is clicked anywhere within this region or within the region around a node tag, if present.
[!code-cpp[TreeViewOwnerDraw#1](~/samples/snippets/cpp/VS_Snippets_Winforms/TreeViewOwnerDraw/CPP/treeviewownerdraw.cpp#1)]
[!code-csharp[TreeViewOwnerDraw#1](~/samples/snippets/csharp/VS_Snippets_Winforms/TreeViewOwnerDraw/CS/treeviewownerdraw.cs#1)]
[!code-vb[TreeViewOwnerDraw#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/TreeViewOwnerDraw/VB/treeviewownerdraw.vb#1)]
]]></format>
</remarks>
<altmember cref="P:System.Windows.Forms.TreeView.DrawMode" />
<altmember cref="T:System.Windows.Forms.DrawTreeNodeEventArgs" />
<altmember cref="T:System.Windows.Forms.TreeNode" />
<altmember cref="T:System.Windows.Forms.TreeViewDrawMode" />
</Docs>
</Member>
<Member MemberName="EndUpdate">
<MemberSignature Language="C#" Value="public void EndUpdate ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void EndUpdate() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.TreeView.EndUpdate" />
<MemberSignature Language="VB.NET" Value="Public Sub EndUpdate ()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void EndUpdate();" />
<MemberSignature Language="F#" Value="member this.EndUpdate : unit -&gt; unit" Usage="treeView.EndUpdate " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Enables the redrawing of the tree view.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
To maintain performance while items are added one at a time to the <xref:System.Windows.Forms.TreeView>, call the <xref:System.Windows.Forms.TreeView.BeginUpdate%2A> method. The <xref:System.Windows.Forms.TreeView.BeginUpdate%2A> method prevents the control from painting until the <xref:System.Windows.Forms.TreeView.EndUpdate%2A> method is called.
The preferred way to add items to a tree view control is to use the <xref:System.Windows.Forms.TreeNodeCollection.AddRange%2A> method to add an array of tree node items to a tree view. However, if you want to add items one at a time, use the <xref:System.Windows.Forms.TreeView.BeginUpdate%2A> method to prevent the <xref:System.Windows.Forms.TreeView> control from painting during the add operations. To allow control the control to resume painting, call the <xref:System.Windows.Forms.TreeView.EndUpdate%2A> method when all the tree nodes have been added to the tree view.
## Examples
The following code example displays customer information in a <xref:System.Windows.Forms.TreeView> control. The root tree nodes display customer names, and the child tree nodes display the order numbers assigned to each customer. In this example, 1,000 customers are displayed with 15 orders each. The repainting of the <xref:System.Windows.Forms.TreeView> is suppressed by using the <xref:System.Windows.Forms.TreeView.BeginUpdate%2A> and <xref:System.Windows.Forms.TreeView.EndUpdate%2A> methods, and a wait <xref:System.Windows.Forms.Cursor> is displayed while the <xref:System.Windows.Forms.TreeView> creates and paints the <xref:System.Windows.Forms.TreeNode> objects. This example requires that you have a `Customer` object that can hold a collection of `Order` objects. It also requires that you have a cursor file that is named `MyWait.cur` in the application directory and that you have created an instance of a <xref:System.Windows.Forms.TreeView> control on a <xref:System.Windows.Forms.Form>.
[!code-cpp[TreeView#1](~/samples/snippets/cpp/VS_Snippets_Winforms/TreeView/CPP/treeview.cpp#1)]
[!code-csharp[TreeView#1](~/samples/snippets/csharp/VS_Snippets_Winforms/TreeView/CS/treeview.cs#1)]
[!code-vb[TreeView#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/TreeView/VB/treeview.vb#1)]
]]></format>
</remarks>
<altmember cref="M:System.Windows.Forms.TreeView.BeginUpdate" />
</Docs>
</Member>
<Member MemberName="ExpandAll">
<MemberSignature Language="C#" Value="public void ExpandAll ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void ExpandAll() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.TreeView.ExpandAll" />
<MemberSignature Language="VB.NET" Value="Public Sub ExpandAll ()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void ExpandAll();" />
<MemberSignature Language="F#" Value="member this.ExpandAll : unit -&gt; unit" Usage="treeView.ExpandAll " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Expands all the tree nodes.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.TreeView.ExpandAll%2A> method expands all the <xref:System.Windows.Forms.TreeNode> objects, which includes all the child tree nodes, that are in the <xref:System.Windows.Forms.TreeView> control.
> [!NOTE]
> The state of a <xref:System.Windows.Forms.TreeNode> persists. For example, suppose that you call the <xref:System.Windows.Forms.TreeNode.ExpandAll%2A> method, and then the individual root tree nodes are collapsed. The child tree nodes have not been collapsed, and will appear in their previously-expanded state when the root tree nodes are expanded again. Calling the <xref:System.Windows.Forms.TreeView.CollapseAll%2A> method ensures that all the tree nodes appear in the collapsed state.
## Examples
The following code example expands all the tree nodes in a <xref:System.Windows.Forms.TreeView> control when a <xref:System.Windows.Forms.CheckBox> is checked, and collapses the <xref:System.Windows.Forms.TreeNode.FirstNode%2A> when the <xref:System.Windows.Forms.CheckBox> is cleared. This example requires that you have a <xref:System.Windows.Forms.Form> with a <xref:System.Windows.Forms.CheckBox>, and a <xref:System.Windows.Forms.TreeView> control with a <xref:System.Windows.Forms.TreeNodeCollection> that has several <xref:System.Windows.Forms.TreeNode> objects (preferably with three or more levels).
[!code-cpp[TreeNode_ForeColor#1](~/samples/snippets/cpp/VS_Snippets_Winforms/TreeNode_ForeColor/CPP/treenode_forecolor.cpp#1)]
[!code-csharp[TreeNode_ForeColor#1](~/samples/snippets/csharp/VS_Snippets_Winforms/TreeNode_ForeColor/CS/treenode_forecolor.cs#1)]
[!code-vb[TreeNode_ForeColor#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_ForeColor/VB/treenode_forecolor.vb#1)]
]]></format>
</remarks>
<altmember cref="M:System.Windows.Forms.TreeNode.Expand" />
<altmember cref="M:System.Windows.Forms.TreeView.CollapseAll" />
</Docs>
</Member>
<Member MemberName="ForeColor">
<MemberSignature Language="C#" Value="public override System.Drawing.Color ForeColor { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Drawing.Color ForeColor" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.TreeView.ForeColor" />
<MemberSignature Language="VB.NET" Value="Public Overrides Property ForeColor As Color" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::Drawing::Color ForeColor { System::Drawing::Color get(); void set(System::Drawing::Color value); };" />
<MemberSignature Language="F#" Value="member this.ForeColor : System.Drawing.Color with get, set" Usage="System.Windows.Forms.TreeView.ForeColor" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Drawing.Color</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the foreground color of the control.</summary>
<value>The foreground <see cref="T:System.Drawing.Color" /> of the control. The default is the value of the <see cref="P:System.Windows.Forms.Control.DefaultForeColor" /> property.</value>
<remarks>To be added.</remarks>
<altmember cref="P:System.Windows.Forms.Control.ForeColor" />
</Docs>
</Member>
<Member MemberName="FullRowSelect">
<MemberSignature Language="C#" Value="public bool FullRowSelect { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool FullRowSelect" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.TreeView.FullRowSelect" />
<MemberSignature Language="VB.NET" Value="Public Property FullRowSelect As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property bool FullRowSelect { bool get(); void set(bool value); };" />
<MemberSignature Language="F#" Value="member this.FullRowSelect : bool with get, set" Usage="System.Windows.Forms.TreeView.FullRowSelect" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value indicating whether the selection highlight spans the width of the tree view control.</summary>
<value>
<see langword="true" /> if the selection highlight spans the width of the tree view control; otherwise, <see langword="false" />. The default is <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
When <xref:System.Windows.Forms.TreeView.FullRowSelect%2A> is `true`, a selection highlight spans the entire width of the tree view, display instead of the width of just the tree node label. The <xref:System.Windows.Forms.TreeView.FullRowSelect%2A> property is ignored if <xref:System.Windows.Forms.TreeView.ShowLines%2A> is set to `true`.
## Examples
The following code example illustrates a customized <xref:System.Windows.Forms.TreeView>. By inheriting the <xref:System.Windows.Forms.TreeView> class, this custom version has all the functionality of a typical <xref:System.Windows.Forms.TreeView>. Changing various property values in the constructor provides a unique appearance. Because the <xref:System.Windows.Forms.TreeView.ShowPlusMinus%2A> property is set to `false`, the customized control also overrides the <xref:System.Windows.Forms.TreeView.OnAfterSelect%2A> method so nodes can be expanded and collapsed when they are clicked.
A control that is customized in this way can be used throughout an organization, making it easy to provide a consistent interface without requiring the control properties to be specified in each individual project.
[!code-cpp[TreeViewCustomization#2](~/samples/snippets/cpp/VS_Snippets_Winforms/TreeViewCustomization/CPP/treeviewcustomization.cpp#2)]
[!code-csharp[TreeViewCustomization#2](~/samples/snippets/csharp/VS_Snippets_Winforms/TreeViewCustomization/CS/treeviewcustomization.cs#2)]
[!code-vb[TreeViewCustomization#2](~/samples/snippets/visualbasic/VS_Snippets_Winforms/TreeViewCustomization/VB/treeviewcustomization.vb#2)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="GetItemRenderStyles">
<MemberSignature Language="C#" Value="protected System.Windows.Forms.OwnerDrawPropertyBag GetItemRenderStyles (System.Windows.Forms.TreeNode node, int state);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig instance class System.Windows.Forms.OwnerDrawPropertyBag GetItemRenderStyles(class System.Windows.Forms.TreeNode node, int32 state) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.TreeView.GetItemRenderStyles(System.Windows.Forms.TreeNode,System.Int32)" />
<MemberSignature Language="VB.NET" Value="Protected Function GetItemRenderStyles (node As TreeNode, state As Integer) As OwnerDrawPropertyBag" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; System::Windows::Forms::OwnerDrawPropertyBag ^ GetItemRenderStyles(System::Windows::Forms::TreeNode ^ node, int state);" />
<MemberSignature Language="F#" Value="member this.GetItemRenderStyles : System.Windows.Forms.TreeNode * int -&gt; System.Windows.Forms.OwnerDrawPropertyBag" Usage="treeView.GetItemRenderStyles (node, state)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Forms.OwnerDrawPropertyBag</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="node" Type="System.Windows.Forms.TreeNode" />
<Parameter Name="state" Type="System.Int32" />
</Parameters>
<Docs>
<param name="node">The <see cref="T:System.Windows.Forms.TreeNode" /> for which to return an <see cref="T:System.Windows.Forms.OwnerDrawPropertyBag" />.</param>
<param name="state">The visible state of the <see cref="T:System.Windows.Forms.TreeNode" />.</param>
<summary>Returns an <see cref="T:System.Windows.Forms.OwnerDrawPropertyBag" /> for the specified <see cref="T:System.Windows.Forms.TreeNode" />.</summary>
<returns>An <see cref="T:System.Windows.Forms.OwnerDrawPropertyBag" /> for the specified <see cref="T:System.Windows.Forms.TreeNode" />.</returns>
<remarks>To be added.</remarks>
</Docs>
</Member>
<MemberGroup MemberName="GetNodeAt">
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Retrieves the tree node that is at the specified location.</summary>
</Docs>
</MemberGroup>
<Member MemberName="GetNodeAt">
<MemberSignature Language="C#" Value="public System.Windows.Forms.TreeNode GetNodeAt (System.Drawing.Point pt);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.Windows.Forms.TreeNode GetNodeAt(valuetype System.Drawing.Point pt) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.TreeView.GetNodeAt(System.Drawing.Point)" />
<MemberSignature Language="VB.NET" Value="Public Function GetNodeAt (pt As Point) As TreeNode" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; System::Windows::Forms::TreeNode ^ GetNodeAt(System::Drawing::Point pt);" />
<MemberSignature Language="F#" Value="member this.GetNodeAt : System.Drawing.Point -&gt; System.Windows.Forms.TreeNode" Usage="treeView.GetNodeAt pt" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Forms.TreeNode</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="pt" Type="System.Drawing.Point" />
</Parameters>
<Docs>
<param name="pt">The <see cref="T:System.Drawing.Point" /> to evaluate and retrieve the node from.</param>
<summary>Retrieves the tree node that is at the specified point.</summary>
<returns>The <see cref="T:System.Windows.Forms.TreeNode" /> at the specified point, in tree view (client) coordinates, or <see langword="null" /> if there is no node at that location.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
You can pass the <xref:System.Windows.Forms.MouseEventArgs.X%2A?displayProperty=nameWithType> and <xref:System.Windows.Forms.MouseEventArgs.Y%2A?displayProperty=nameWithType> coordinates of the <xref:System.Windows.Forms.Control.MouseDown> event as the <xref:System.Drawing.Point.X%2A> and <xref:System.Drawing.Point.Y%2A> values of a new <xref:System.Drawing.Point>.
]]></format>
</remarks>
<altmember cref="T:System.Drawing.Point" />
</Docs>
</Member>
<Member MemberName="GetNodeAt">
<MemberSignature Language="C#" Value="public System.Windows.Forms.TreeNode GetNodeAt (int x, int y);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.Windows.Forms.TreeNode GetNodeAt(int32 x, int32 y) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.TreeView.GetNodeAt(System.Int32,System.Int32)" />
<MemberSignature Language="VB.NET" Value="Public Function GetNodeAt (x As Integer, y As Integer) As TreeNode" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; System::Windows::Forms::TreeNode ^ GetNodeAt(int x, int y);" />
<MemberSignature Language="F#" Value="member this.GetNodeAt : int * int -&gt; System.Windows.Forms.TreeNode" Usage="treeView.GetNodeAt (x, y)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Forms.TreeNode</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="x" Type="System.Int32" />
<Parameter Name="y" Type="System.Int32" />
</Parameters>
<Docs>
<param name="x">The <see cref="P:System.Drawing.Point.X" /> position to evaluate and retrieve the node from.</param>
<param name="y">The <see cref="P:System.Drawing.Point.Y" /> position to evaluate and retrieve the node from.</param>
<summary>Retrieves the tree node at the point with the specified coordinates.</summary>
<returns>The <see cref="T:System.Windows.Forms.TreeNode" /> at the specified location, in tree view (client) coordinates, or <see langword="null" /> if there is no node at that location.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
You can pass the <xref:System.Windows.Forms.MouseEventArgs.X%2A?displayProperty=nameWithType> and <xref:System.Windows.Forms.MouseEventArgs.Y%2A?displayProperty=nameWithType> coordinates of the <xref:System.Windows.Forms.Control.MouseDown> event as the `x` and `y` parameters.
## Examples
The following code example lets the user edit nonroot tree nodes by using a <xref:System.Windows.Forms.ContextMenu>. When the user right clicks the mouse, the <xref:System.Windows.Forms.TreeNode> at that position is determined and stored in a variable named `mySelectedNode`. If a nonroot tree node was selected, it is put into an editable state, which allows the user to edit the node label. After the user stops editing the tree node label, the new label text is evaluated and saved. For this example, several characters are considered not valid in the label text. If one of the invalid characters is in the label string, or the string is empty, the user is notified of the error and the label is returned to its previous text.
[!code-cpp[classic treenode.beginedit example#1](~/samples/snippets/cpp/VS_Snippets_CLR_Classic/classic TreeNode.BeginEdit Example/CPP/source.cpp#1)]
[!code-csharp[classic treenode.beginedit example#1](~/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic TreeNode.BeginEdit Example/CS/source.cs#1)]
[!code-vb[classic treenode.beginedit example#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_Classic/classic TreeNode.BeginEdit Example/VB/source.vb#1)]
]]></format>
</remarks>
<altmember cref="T:System.Drawing.Point" />
</Docs>
</Member>
<Member MemberName="GetNodeCount">
<MemberSignature Language="C#" Value="public int GetNodeCount (bool includeSubTrees);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance int32 GetNodeCount(bool includeSubTrees) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.TreeView.GetNodeCount(System.Boolean)" />
<MemberSignature Language="VB.NET" Value="Public Function GetNodeCount (includeSubTrees As Boolean) As Integer" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; int GetNodeCount(bool includeSubTrees);" />
<MemberSignature Language="F#" Value="member this.GetNodeCount : bool -&gt; int" Usage="treeView.GetNodeCount includeSubTrees" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="includeSubTrees" Type="System.Boolean" />
</Parameters>
<Docs>
<param name="includeSubTrees">
<see langword="true" /> to count the <see cref="T:System.Windows.Forms.TreeNode" /> items that the subtrees contain; otherwise, <see langword="false" />.</param>
<summary>Retrieves the number of tree nodes, optionally including those in all subtrees, assigned to the tree view control.</summary>
<returns>The number of tree nodes, optionally including those in all subtrees, assigned to the tree view control.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If `includeSubTrees` is `true`, the result is the number of all the tree nodes in the entire tree structure.
## Examples
The following code example sets the <xref:System.Windows.Forms.TreeView.PathSeparator%2A> property of a <xref:System.Windows.Forms.TreeView> and displays the number of child tree nodes that are contained in the <xref:System.Windows.Forms.TreeNodeCollection> of the <xref:System.Windows.Forms.TreeView.SelectedNode%2A>. The percentage of child tree node to total tree nodes in the tree view control is also displayed. This example requires that you have a <xref:System.Windows.Forms.Form> with a <xref:System.Windows.Forms.Button>, and a <xref:System.Windows.Forms.TreeView> control with a <xref:System.Windows.Forms.TreeNodeCollection> that has several <xref:System.Windows.Forms.TreeNode> objects (preferably with three or more levels).
[!code-cpp[TreeNode_ForeColor#2](~/samples/snippets/cpp/VS_Snippets_Winforms/TreeNode_ForeColor/CPP/treenode_forecolor.cpp#2)]
[!code-csharp[TreeNode_ForeColor#2](~/samples/snippets/csharp/VS_Snippets_Winforms/TreeNode_ForeColor/CS/treenode_forecolor.cs#2)]
[!code-vb[TreeNode_ForeColor#2](~/samples/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_ForeColor/VB/treenode_forecolor.vb#2)]
]]></format>
</remarks>
<altmember cref="T:System.Windows.Forms.TreeNode" />
</Docs>
</Member>
<Member MemberName="HideSelection">
<MemberSignature Language="C#" Value="public bool HideSelection { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool HideSelection" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.TreeView.HideSelection" />
<MemberSignature Language="VB.NET" Value="Public Property HideSelection As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property bool HideSelection { bool get(); void set(bool value); };" />
<MemberSignature Language="F#" Value="member this.HideSelection : bool with get, set" Usage="System.Windows.Forms.TreeView.HideSelection" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(true)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value indicating whether the selected tree node remains highlighted even when the tree view has lost the focus.</summary>
<value>
<see langword="true" /> if the selected tree node is not highlighted when the tree view has lost the focus; otherwise, <see langword="false" />. The default is <see langword="true" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
When this property is set to `false`, selected nodes in the <xref:System.Windows.Forms.TreeView> control remain highlighted in a different color than the current selection color when the <xref:System.Windows.Forms.TreeView> control loses focus. You can use this property to keep items that are selected by the user visible when the user clicks a different control on the form or moves to a different window.
> [!NOTE]
> If you are concerned with the accessibility of your applications, it is recommended that you set the <xref:System.Windows.Forms.TreeView.HideSelection%2A> property to `false`.
## Examples
The following code example demonstrates how to use the <xref:System.Windows.Forms.TreeView.HideSelection%2A> property. To run this example, paste the following code in a form and call the `InitializeSelectedTreeView` method in the form's constructor or <xref:System.Windows.Forms.Form.Load> event handler.
[!code-cpp[System.Windows.Forms.TreeViewExample#2](~/samples/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.TreeViewExample/CPP/form1.cpp#2)]
[!code-csharp[System.Windows.Forms.TreeViewExample#2](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.TreeViewExample/CS/form1.cs#2)]
[!code-vb[System.Windows.Forms.TreeViewExample#2](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TreeViewExample/VB/form1.vb#2)]
]]></format>
</remarks>
<altmember cref="P:System.Windows.Forms.TreeView.SelectedNode" />
</Docs>
</Member>
<MemberGroup MemberName="HitTest">
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Provides node information, given a point.</summary>
</Docs>
</MemberGroup>
<Member MemberName="HitTest">
<MemberSignature Language="C#" Value="public System.Windows.Forms.TreeViewHitTestInfo HitTest (System.Drawing.Point pt);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.Windows.Forms.TreeViewHitTestInfo HitTest(valuetype System.Drawing.Point pt) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.TreeView.HitTest(System.Drawing.Point)" />
<MemberSignature Language="VB.NET" Value="Public Function HitTest (pt As Point) As TreeViewHitTestInfo" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; System::Windows::Forms::TreeViewHitTestInfo ^ HitTest(System::Drawing::Point pt);" />
<MemberSignature Language="F#" Value="member this.HitTest : System.Drawing.Point -&gt; System.Windows.Forms.TreeViewHitTestInfo" Usage="treeView.HitTest pt" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Forms.TreeViewHitTestInfo</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="pt" Type="System.Drawing.Point" Index="0" FrameworkAlternate="netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
</Parameters>
<Docs>
<param name="pt">The <see cref="T:System.Drawing.Point" /> at which to retrieve node information.</param>
<summary>Provides node information, given a point.</summary>
<returns>The node information.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use this method to determine whether a point is located in a <xref:System.Windows.Forms.TreeNode> and where within the node the point is located, such as on the label or image area.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="HitTest">
<MemberSignature Language="C#" Value="public System.Windows.Forms.TreeViewHitTestInfo HitTest (int x, int y);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.Windows.Forms.TreeViewHitTestInfo HitTest(int32 x, int32 y) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.TreeView.HitTest(System.Int32,System.Int32)" />
<MemberSignature Language="VB.NET" Value="Public Function HitTest (x As Integer, y As Integer) As TreeViewHitTestInfo" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; System::Windows::Forms::TreeViewHitTestInfo ^ HitTest(int x, int y);" />
<MemberSignature Language="F#" Value="member this.HitTest : int * int -&gt; System.Windows.Forms.TreeViewHitTestInfo" Usage="treeView.HitTest (x, y)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Forms.TreeViewHitTestInfo</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="x" Type="System.Int32" Index="0" FrameworkAlternate="netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
<Parameter Name="y" Type="System.Int32" Index="1" FrameworkAlternate="netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
</Parameters>
<Docs>
<param name="x">The x-coordinate at which to retrieve node information</param>
<param name="y">The y-coordinate at which to retrieve node information.</param>
<summary>Provides node information, given x- and y-coordinates.</summary>
<returns>The node information.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use this method to determine whether a set of x- and y-coordinates is located in a <xref:System.Windows.Forms.TreeNode> and where within the node the point is located, such as on the label or image area.
## Examples
The following code example code demonstrates how to use the <xref:System.Windows.Forms.TreeNode.Level%2A>, <xref:System.Windows.Forms.TreeViewHitTestInfo.Node%2A>, and <xref:System.Windows.Forms.TreeView.HitTest%2A> members. To run this example, create a Windows Form that contains a <xref:System.Windows.Forms.TreeView> named `treeView1` and populate it with several levels of nodes. Paste the following code into the form and associate the <xref:System.Windows.Forms.Control.MouseDown> event of `treeView1` with the `treeView1_MouseDown` method in this example.
[!code-cpp[System.Windows.Forms.TreeViewWhidbeyMembers#3](~/samples/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.TreeViewWhidbeyMembers/cpp/Form1.cpp#3)]
[!code-csharp[System.Windows.Forms.TreeViewWhidbeyMembers#3](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.TreeViewWhidbeyMembers/CS/Form1.cs#3)]
[!code-vb[System.Windows.Forms.TreeViewWhidbeyMembers#3](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TreeViewWhidbeyMembers/VB/Form1.vb#3)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="HotTracking">
<MemberSignature Language="C#" Value="public bool HotTracking { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool HotTracking" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.TreeView.HotTracking" />
<MemberSignature Language="VB.NET" Value="Public Property HotTracking As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property bool HotTracking { bool get(); void set(bool value); };" />
<MemberSignature Language="F#" Value="member this.HotTracking : bool with get, set" Usage="System.Windows.Forms.TreeView.HotTracking" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value indicating whether a tree node label takes on the appearance of a hyperlink as the mouse pointer passes over it.</summary>
<value>
<see langword="true" /> if a tree node label takes on the appearance of a hyperlink as the mouse pointer passes over it; otherwise, <see langword="false" />. The default is <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If the <xref:System.Windows.Forms.TreeView.CheckBoxes%2A> property is set to `true`, the <xref:System.Windows.Forms.TreeView.HotTracking%2A> property has no effect.
> [!NOTE]
> When the <xref:System.Windows.Forms.TreeView.HotTracking%2A> property is set to `true`, each tree node label takes on the appearance of a hyperlink as the mouse pointer passes over it. The <xref:System.Drawing.FontStyle.Underline> font style is applied to the <xref:System.Drawing.Font> and the <xref:System.Windows.Forms.Control.ForeColor%2A> is set to blue to make the label appear as a link. The appearance is not controlled by the Internet settings of the user's operating system.
## Examples
The following code example illustrates a customized <xref:System.Windows.Forms.TreeView>. By inheriting the <xref:System.Windows.Forms.TreeView> class, this custom version has all the functionality of a typical <xref:System.Windows.Forms.TreeView>. Changing various property values in the constructor provides a unique appearance. Because the <xref:System.Windows.Forms.TreeView.ShowPlusMinus%2A> property is set to `false`, the customized control also overrides the <xref:System.Windows.Forms.TreeView.OnAfterSelect%2A> method so that nodes can be expanded and collapsed when they are clicked.
A control that is customized in this way can be used throughout an organization, making it easy to provide a consistent interface without requiring the control properties to be specified in each individual project.
[!code-cpp[TreeViewCustomization#2](~/samples/snippets/cpp/VS_Snippets_Winforms/TreeViewCustomization/CPP/treeviewcustomization.cpp#2)]
[!code-csharp[TreeViewCustomization#2](~/samples/snippets/csharp/VS_Snippets_Winforms/TreeViewCustomization/CS/treeviewcustomization.cs#2)]
[!code-vb[TreeViewCustomization#2](~/samples/snippets/visualbasic/VS_Snippets_Winforms/TreeViewCustomization/VB/treeviewcustomization.vb#2)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="ImageIndex">
<MemberSignature Language="C#" Value="public int ImageIndex { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance int32 ImageIndex" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.TreeView.ImageIndex" />
<MemberSignature Language="VB.NET" Value="Public Property ImageIndex As Integer" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property int ImageIndex { int get(); void set(int value); };" />
<MemberSignature Language="F#" Value="member this.ImageIndex : int with get, set" Usage="System.Windows.Forms.TreeView.ImageIndex" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netcore-3.0">
<AttributeName>System.ComponentModel.DefaultValue(-1)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netcore-3.0">
<AttributeName>System.ComponentModel.Editor("System.Windows.Forms.Design.ImageIndexEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(System.Drawing.Design.UITypeEditor))</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.Localizable(true)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netcore-3.0">
<AttributeName>System.ComponentModel.TypeConverter(typeof(System.Windows.Forms.NoneExcludedImageIndexConverter))</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netcore-3.0">
<AttributeName>System.Windows.Forms.RelatedImageList("ImageList")</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-1.1">
<AttributeName>System.ComponentModel.DefaultValue(0)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-1.1">
<AttributeName>System.ComponentModel.Editor("System.Windows.Forms.Design.ImageIndexEditor, System.Design, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(System.Drawing.Design.UITypeEditor))</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-1.1">
<AttributeName>System.ComponentModel.TypeConverter(typeof(System.Windows.Forms.TreeViewImageIndexConverter))</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5">
<AttributeName>System.ComponentModel.Editor("System.Windows.Forms.Design.ImageIndexEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(System.Drawing.Design.UITypeEditor))</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netcore-3.0">
<AttributeName>System.ComponentModel.RefreshProperties(System.ComponentModel.RefreshProperties.Repaint)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the image-list index value of the default image that is displayed by the tree nodes.</summary>
<value>A zero-based index that represents the position of an <see cref="T:System.Drawing.Image" /> in an <see cref="T:System.Windows.Forms.ImageList" />. The default is zero.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.TreeView.ImageIndex%2A> value is the index of an <xref:System.Drawing.Image> stored in the <xref:System.Windows.Forms.ImageList> assigned to the <xref:System.Windows.Forms.TreeView.ImageList%2A> property.
The <xref:System.Windows.Forms.TreeView.ImageKey%2A> and <xref:System.Windows.Forms.TreeView.ImageIndex%2A> properties are mutually exclusive; if one is set, the other is ignored. If you set <xref:System.Windows.Forms.TreeView.ImageKey%2A>, <xref:System.Windows.Forms.TreeView.ImageIndex%2A> is automatically set to -1. Alternatively, if you set <xref:System.Windows.Forms.TreeView.ImageIndex%2A>, <xref:System.Windows.Forms.TreeView.ImageKey%2A> is automatically set to an empty string ("").
> [!NOTE]
> When setting the <xref:System.Windows.Forms.TreeView.ImageIndex%2A> property at run time, the <xref:System.Windows.Forms.TreeView> handle is recreated (see <xref:System.Windows.Forms.Control.RecreateHandle%2A?displayProperty=nameWithType>) to update the control's appearance. This causes all tree nodes to be collapsed, with the exception of the selected <xref:System.Windows.Forms.TreeNode>.
## Examples
The following code example creates and assigns an <xref:System.Windows.Forms.ImageList> to a <xref:System.Windows.Forms.TreeView> control and fills the <xref:System.Windows.Forms.TreeView> control with <xref:System.Windows.Forms.TreeNode> objects. The tree nodes are assigned images from the <xref:System.Windows.Forms.ImageList> that are displayed when in a selected or unselected state. This example requires that you have a <xref:System.Windows.Forms.Form> that contains a <xref:System.Windows.Forms.TreeView>, and an <xref:System.Collections.ArrayList> that contains `Customer` objects that each contain `Order` objects. It is also assumed that the `Customer` and `Order` objects are defined.
[!code-cpp[TreeNode_TreeNode#1](~/samples/snippets/cpp/VS_Snippets_Winforms/TreeNode_TreeNode/CPP/treenode_treenode.cpp#1)]
[!code-csharp[TreeNode_TreeNode#1](~/samples/snippets/csharp/VS_Snippets_Winforms/TreeNode_TreeNode/CS/treenode_treenode.cs#1)]
[!code-vb[TreeNode_TreeNode#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_TreeNode/VB/treenode_treenode.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">The specified index is less than 0.</exception>
</Docs>
</Member>
<Member MemberName="ImageKey">
<MemberSignature Language="C#" Value="public string ImageKey { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance string ImageKey" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.TreeView.ImageKey" />
<MemberSignature Language="VB.NET" Value="Public Property ImageKey As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::String ^ ImageKey { System::String ^ get(); void set(System::String ^ value); };" />
<MemberSignature Language="F#" Value="member this.ImageKey : string with get, set" Usage="System.Windows.Forms.TreeView.ImageKey" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netcore-3.0">
<AttributeName>System.ComponentModel.DefaultValue("")</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netcore-3.0">
<AttributeName>System.ComponentModel.Editor("System.Windows.Forms.Design.ImageIndexEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(System.Drawing.Design.UITypeEditor))</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netcore-3.0">
<AttributeName>System.ComponentModel.Localizable(true)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netcore-3.0">
<AttributeName>System.ComponentModel.TypeConverter(typeof(System.Windows.Forms.ImageKeyConverter))</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netcore-3.0">
<AttributeName>System.Windows.Forms.RelatedImageList("ImageList")</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5">
<AttributeName>System.ComponentModel.Editor("System.Windows.Forms.Design.ImageIndexEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(System.Drawing.Design.UITypeEditor))</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netcore-3.0">
<AttributeName>System.ComponentModel.RefreshProperties(System.ComponentModel.RefreshProperties.Repaint)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the key of the default image for each node in the <see cref="T:System.Windows.Forms.TreeView" /> control when it is in an unselected state.</summary>
<value>The key of the default image shown for each node <see cref="T:System.Windows.Forms.TreeView" /> control when the node is in an unselected state.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.TreeView.ImageKey%2A> property is case-insensitive.
If a <xref:System.Windows.Forms.TreeNode> does not have an image set, the image specified by the <xref:System.Windows.Forms.TreeView.ImageKey%2A> property will be shown when the node is not selected. When the node is selected, the first item in the <xref:System.Windows.Forms.ImageList> will be shown.
The <xref:System.Windows.Forms.TreeView.ImageKey%2A> and <xref:System.Windows.Forms.TreeView.ImageIndex%2A> properties are mutually exclusive, meaning if one is set, the other is ignored. If you set the <xref:System.Windows.Forms.TreeView.ImageKey%2A> property, the <xref:System.Windows.Forms.TreeView.ImageIndex%2A> property is automatically set to -1. Alternatively, if you set the <xref:System.Windows.Forms.TreeView.ImageIndex%2A> property, the <xref:System.Windows.Forms.TreeView.ImageKey%2A> is automatically set to an empty string ("").
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="ImageList">
<MemberSignature Language="C#" Value="public System.Windows.Forms.ImageList ImageList { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Windows.Forms.ImageList ImageList" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.TreeView.ImageList" />
<MemberSignature Language="VB.NET" Value="Public Property ImageList As ImageList" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Windows::Forms::ImageList ^ ImageList { System::Windows::Forms::ImageList ^ get(); void set(System::Windows::Forms::ImageList ^ value); };" />
<MemberSignature Language="F#" Value="member this.ImageList : System.Windows.Forms.ImageList with get, set" Usage="System.Windows.Forms.TreeView.ImageList" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(null)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netcore-3.0">
<AttributeName>System.ComponentModel.RefreshProperties(System.ComponentModel.RefreshProperties.Repaint)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Windows.Forms.ImageList</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the <see cref="T:System.Windows.Forms.ImageList" /> that contains the <see cref="T:System.Drawing.Image" /> objects that are used by the tree nodes.</summary>
<value>The <see cref="T:System.Windows.Forms.ImageList" /> that contains the <see cref="T:System.Drawing.Image" /> objects that are used by the tree nodes. The default value is <see langword="null" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If the <xref:System.Windows.Forms.ImageList> property value is anything other than `null`, all the tree nodes display the first <xref:System.Drawing.Image> stored in the <xref:System.Windows.Forms.ImageList>. You can specify which images from the list are displayed for selected and unselected nodes by setting the <xref:System.Windows.Forms.TreeView.ImageIndex%2A> and <xref:System.Windows.Forms.TreeView.SelectedImageIndex%2A> properties. Individual <xref:System.Windows.Forms.TreeNode> objects can specify which image is displayed by setting their <xref:System.Windows.Forms.TreeNode.ImageIndex%2A> and <xref:System.Windows.Forms.TreeNode.SelectedImageIndex%2A> properties. These individual settings will override the settings in the corresponding <xref:System.Windows.Forms.TreeView> properties.
> [!NOTE]
> In the .NET Framework version 1.1, there is an issue that prevents images from appearing on <xref:System.Windows.Forms.TreeView> nodes when your application calls <xref:System.Windows.Forms.Application.EnableVisualStyles%2A?displayProperty=nameWithType>. To work around this issue, call <xref:System.Windows.Forms.Application.DoEvents%2A?displayProperty=nameWithType> in your `Main` method immediately after you call <xref:System.Windows.Forms.Application.EnableVisualStyles%2A>. This issue is fixed in the [!INCLUDE[dnprdnlong](~/includes/dnprdnlong-md.md)].
## Examples
The following code example creates and assigns an <xref:System.Windows.Forms.ImageList> to a <xref:System.Windows.Forms.TreeView> control and fills the <xref:System.Windows.Forms.TreeView> control with <xref:System.Windows.Forms.TreeNode> objects. The tree nodes are assigned images from the <xref:System.Windows.Forms.ImageList> that are displayed when in a selected or unselected state. This example requires that you have a <xref:System.Windows.Forms.Form> that contains a <xref:System.Windows.Forms.TreeView>, and an <xref:System.Collections.ArrayList> that contains `Customer` objects that each contain `Order` objects.
[!code-cpp[TreeNode_TreeNode#1](~/samples/snippets/cpp/VS_Snippets_Winforms/TreeNode_TreeNode/CPP/treenode_treenode.cpp#1)]
[!code-csharp[TreeNode_TreeNode#1](~/samples/snippets/csharp/VS_Snippets_Winforms/TreeNode_TreeNode/CS/treenode_treenode.cs#1)]
[!code-vb[TreeNode_TreeNode#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_TreeNode/VB/treenode_treenode.vb#1)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Indent">
<MemberSignature Language="C#" Value="public int Indent { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance int32 Indent" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.TreeView.Indent" />
<MemberSignature Language="VB.NET" Value="Public Property Indent As Integer" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property int Indent { int get(); void set(int value); };" />
<MemberSignature Language="F#" Value="member this.Indent : int with get, set" Usage="System.Windows.Forms.TreeView.Indent" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Localizable(true)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the distance to indent each child tree node level.</summary>
<value>The distance, in pixels, to indent each child tree node level. The default value is 19.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Setting this property to a value of -1 does not throw an exception if the value has not yet been changed from its default. This is because the control uses a value of -1 as an internal default before the control handle has been created. This internal default value causes the wrapped control to return its own default value of 19.
## Examples
The following code example illustrates a customized <xref:System.Windows.Forms.TreeView>. By inheriting the <xref:System.Windows.Forms.TreeView> class, this custom version has all the functionality of a typical <xref:System.Windows.Forms.TreeView>. Changing various property values in the constructor provides a unique appearance. Because the <xref:System.Windows.Forms.TreeView.ShowPlusMinus%2A> property is set to false, the customized control also overrides the <xref:System.Windows.Forms.TreeView.OnAfterSelect%2A> method so that nodes can be expanded and collapsed when they are clicked.
A control that is customized in this way can be used throughout an organization, making it easy to provide a consistent interface without requiring the control properties to be specified in each individual project.
[!code-cpp[TreeViewCustomization#2](~/samples/snippets/cpp/VS_Snippets_Winforms/TreeViewCustomization/CPP/treeviewcustomization.cpp#2)]
[!code-csharp[TreeViewCustomization#2](~/samples/snippets/csharp/VS_Snippets_Winforms/TreeViewCustomization/CS/treeviewcustomization.cs#2)]
[!code-vb[TreeViewCustomization#2](~/samples/snippets/visualbasic/VS_Snippets_Winforms/TreeViewCustomization/VB/treeviewcustomization.vb#2)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">The assigned value is less than 0.
-or-
The assigned value is greater than 32,000.</exception>
</Docs>
</Member>
<Member MemberName="IsInputKey">
<MemberSignature Language="C#" Value="protected override bool IsInputKey (System.Windows.Forms.Keys keyData);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance bool IsInputKey(valuetype System.Windows.Forms.Keys keyData) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.TreeView.IsInputKey(System.Windows.Forms.Keys)" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Function IsInputKey (keyData As Keys) As Boolean" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; override bool IsInputKey(System::Windows::Forms::Keys keyData);" />
<MemberSignature Language="F#" Value="override this.IsInputKey : System.Windows.Forms.Keys -&gt; bool" Usage="treeView.IsInputKey keyData" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="keyData" Type="System.Windows.Forms.Keys" />
</Parameters>
<Docs>
<param name="keyData">One of the Keys values.</param>
<summary>Determines whether the specified key is a regular input key or a special key that requires preprocessing.</summary>
<returns>
<see langword="true" /> if the specified key is a regular input key; otherwise, <see langword="false" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If the user is editing a tree node, the <xref:System.Windows.Forms.TreeView> control treats keys such as ENTER, ESC, HOME, and END as input keys.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="ItemDrag">
<MemberSignature Language="C#" Value="public event System.Windows.Forms.ItemDragEventHandler ItemDrag;" />
<MemberSignature Language="ILAsm" Value=".event class System.Windows.Forms.ItemDragEventHandler ItemDrag" />
<MemberSignature Language="DocId" Value="E:System.Windows.Forms.TreeView.ItemDrag" />
<MemberSignature Language="VB.NET" Value="Public Custom Event ItemDrag As ItemDragEventHandler " />
<MemberSignature Language="C++ CLI" Value="public:&#xA; event System::Windows::Forms::ItemDragEventHandler ^ ItemDrag;" />
<MemberSignature Language="F#" Value="member this.ItemDrag : System.Windows.Forms.ItemDragEventHandler " Usage="member this.ItemDrag : System.Windows.Forms.ItemDragEventHandler " />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Forms.ItemDragEventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs when the user begins dragging a node.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
For more information about handling events, see [Handling and Raising Events](~/docs/standard/events/index.md).
## Examples
The following code example demonstrates how to enable drag-and-drop operations within a <xref:System.Windows.Forms.TreeView> control. In this example, any node can be dragged to another node that is not a descendant of the dragged node. The dragged node, which includes all its descendant nodes, becomes a child of the destination node. When the left mouse button is used, the dragged node is moved to the destination node. When the right mouse button is used, the dragged node is copied to the destination node.
[!code-cpp[TreeViewDragDrop#1](~/samples/snippets/cpp/VS_Snippets_Winforms/TreeViewDragDrop/CPP/treeviewdragdrop.cpp#1)]
[!code-csharp[TreeViewDragDrop#1](~/samples/snippets/csharp/VS_Snippets_Winforms/TreeViewDragDrop/CS/treeviewdragdrop.cs#1)]
[!code-vb[TreeViewDragDrop#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/TreeViewDragDrop/VB/treeviewdragdrop.vb#1)]
]]></format>
</remarks>
<altmember cref="M:System.Windows.Forms.TreeView.OnItemDrag(System.Windows.Forms.ItemDragEventArgs)" />
</Docs>
</Member>
<Member MemberName="ItemHeight">
<MemberSignature Language="C#" Value="public int ItemHeight { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance int32 ItemHeight" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.TreeView.ItemHeight" />
<MemberSignature Language="VB.NET" Value="Public Property ItemHeight As Integer" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property int ItemHeight { int get(); void set(int value); };" />
<MemberSignature Language="F#" Value="member this.ItemHeight : int with get, set" Usage="System.Windows.Forms.TreeView.ItemHeight" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-1.1">
<AttributeName>System.ComponentModel.Localizable(true)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the height of each tree node in the tree view control.</summary>
<value>The height, in pixels, of each tree node in the tree view.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If the item height is set to a value larger than the height of the tree view control, calling the <xref:System.Windows.Forms.TreeNode.EnsureVisible%2A?displayProperty=nameWithType> method will have unexpected results.
## Examples
The following code example changes the size <xref:System.Windows.Forms.TreeNode.NodeFont%2A> to the specified size and adjusts the <xref:System.Windows.Forms.TreeView.ItemHeight%2A> of the tree node's parent <xref:System.Windows.Forms.TreeView> control. This example requires that you have a <xref:System.Windows.Forms.Form> with a <xref:System.Windows.Forms.TreeView> control with a collection of <xref:System.Windows.Forms.TreeNode> objects, and a <xref:System.Windows.Forms.ComboBox> that contains font sizes.
[!code-cpp[TreeNode_Bounds#2](~/samples/snippets/cpp/VS_Snippets_Winforms/TreeNode_Bounds/CPP/treenode_bounds.cpp#2)]
[!code-csharp[TreeNode_Bounds#2](~/samples/snippets/csharp/VS_Snippets_Winforms/TreeNode_Bounds/CS/treenode_bounds.cs#2)]
[!code-vb[TreeNode_Bounds#2](~/samples/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Bounds/VB/treenode_bounds.vb#2)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">The assigned value is less than one.
-or-
The assigned value is greater than the <see cref="F:System.Int16.MaxValue" /> value.</exception>
<altmember cref="F:System.Int16.MaxValue" />
</Docs>
</Member>
<Member MemberName="LabelEdit">
<MemberSignature Language="C#" Value="public bool LabelEdit { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool LabelEdit" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.TreeView.LabelEdit" />
<MemberSignature Language="VB.NET" Value="Public Property LabelEdit As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property bool LabelEdit { bool get(); void set(bool value); };" />
<MemberSignature Language="F#" Value="member this.LabelEdit : bool with get, set" Usage="System.Windows.Forms.TreeView.LabelEdit" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value indicating whether the label text of the tree nodes can be edited.</summary>
<value>
<see langword="true" /> if the label text of the tree nodes can be edited; otherwise, <see langword="false" />. The default is <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.TreeNode.BeginEdit%2A> method works only if the <xref:System.Windows.Forms.TreeView.LabelEdit%2A> property is `true`. If <xref:System.Windows.Forms.TreeView.LabelEdit%2A> is `false` when you attempt to edit the label, an exception will be thrown and the tree node will not be put in to an editable state.
## Examples
The following code example lets the user edit nonroot tree nodes by using a <xref:System.Windows.Forms.ContextMenu>. When the user right clicks the mouse, the <xref:System.Windows.Forms.TreeNode> at that position is determined and stored in a variable named `mySelectedNode`. If a nonroot tree node was selected, it is put into an editable state, which allows the user to edit the node label. After the user stops editing the tree node label, the new label text is evaluated and saved. For this example, several characters are considered not valid in the label text. If one of the invalid characters is in the label string, or the string is empty, the user is notified of the error and the label is returned to its previous text.
[!code-cpp[classic treenode.beginedit example#1](~/samples/snippets/cpp/VS_Snippets_CLR_Classic/classic TreeNode.BeginEdit Example/CPP/source.cpp#1)]
[!code-csharp[classic treenode.beginedit example#1](~/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic TreeNode.BeginEdit Example/CS/source.cs#1)]
[!code-vb[classic treenode.beginedit example#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_Classic/classic TreeNode.BeginEdit Example/VB/source.vb#1)]
]]></format>
</remarks>
<altmember cref="M:System.Windows.Forms.TreeNode.BeginEdit" />
<altmember cref="M:System.Windows.Forms.TreeNode.EndEdit(System.Boolean)" />
</Docs>
</Member>
<Member MemberName="LineColor">
<MemberSignature Language="C#" Value="public System.Drawing.Color LineColor { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Drawing.Color LineColor" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.TreeView.LineColor" />
<MemberSignature Language="VB.NET" Value="Public Property LineColor As Color" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Drawing::Color LineColor { System::Drawing::Color get(); void set(System::Drawing::Color value); };" />
<MemberSignature Language="F#" Value="member this.LineColor : System.Drawing.Color with get, set" Usage="System.Windows.Forms.TreeView.LineColor" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netcore-3.0">
<AttributeName>System.ComponentModel.DefaultValue(typeof(System.Drawing.Color), "Black")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Drawing.Color</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the color of the lines connecting the nodes of the <see cref="T:System.Windows.Forms.TreeView" /> control.</summary>
<value>The <see cref="T:System.Drawing.Color" /> of the lines connecting the tree nodes.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following code example demonstrates setting the <xref:System.Windows.Forms.TreeNode> line color. To run this example, paste the code into a Windows Form. Call `InitializeLineTreeView` from the form's constructor or <xref:System.Windows.Forms.Form.Load> event handler.
[!code-cpp[System.Windows.Forms.TreeViewWhidbeyMembers#2](~/samples/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.TreeViewWhidbeyMembers/cpp/Form1.cpp#2)]
[!code-csharp[System.Windows.Forms.TreeViewWhidbeyMembers#2](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.TreeViewWhidbeyMembers/CS/Form1.cs#2)]
[!code-vb[System.Windows.Forms.TreeViewWhidbeyMembers#2](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TreeViewWhidbeyMembers/VB/Form1.vb#2)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="NodeMouseClick">
<MemberSignature Language="C#" Value="public event System.Windows.Forms.TreeNodeMouseClickEventHandler NodeMouseClick;" />
<MemberSignature Language="ILAsm" Value=".event class System.Windows.Forms.TreeNodeMouseClickEventHandler NodeMouseClick" />
<MemberSignature Language="DocId" Value="E:System.Windows.Forms.TreeView.NodeMouseClick" />
<MemberSignature Language="VB.NET" Value="Public Custom Event NodeMouseClick As TreeNodeMouseClickEventHandler " />
<MemberSignature Language="C++ CLI" Value="public:&#xA; event System::Windows::Forms::TreeNodeMouseClickEventHandler ^ NodeMouseClick;" />
<MemberSignature Language="F#" Value="member this.NodeMouseClick : System.Windows.Forms.TreeNodeMouseClickEventHandler " Usage="member this.NodeMouseClick : System.Windows.Forms.TreeNodeMouseClickEventHandler " />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Forms.TreeNodeMouseClickEventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs when the user clicks a <see cref="T:System.Windows.Forms.TreeNode" /> with the mouse.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This event occurs when the user clicks any part of a tree node with the mouse, including the plus sign (**+**) or minus sign (**-**) that indicates whether the node is collapsed or expanded.
For more information about how to handle events, see [Handling and Raising Events](~/docs/standard/events/index.md).
## Examples
The following code example demonstrates how to handle the <xref:System.Windows.Forms.TreeView.NodeMouseClick> event.
[!code-cpp[System.Windows.Forms.TreeViewWhidbeyMembers#4](~/samples/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.TreeViewWhidbeyMembers/cpp/Form1.cpp#4)]
[!code-csharp[System.Windows.Forms.TreeViewWhidbeyMembers#4](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.TreeViewWhidbeyMembers/CS/Form1.cs#4)]
[!code-vb[System.Windows.Forms.TreeViewWhidbeyMembers#4](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TreeViewWhidbeyMembers/VB/Form1.vb#4)]
]]></format>
</remarks>
<altmember cref="T:System.Windows.Forms.TreeNodeMouseClickEventArgs" />
</Docs>
</Member>
<Member MemberName="NodeMouseDoubleClick">
<MemberSignature Language="C#" Value="public event System.Windows.Forms.TreeNodeMouseClickEventHandler NodeMouseDoubleClick;" />
<MemberSignature Language="ILAsm" Value=".event class System.Windows.Forms.TreeNodeMouseClickEventHandler NodeMouseDoubleClick" />
<MemberSignature Language="DocId" Value="E:System.Windows.Forms.TreeView.NodeMouseDoubleClick" />
<MemberSignature Language="VB.NET" Value="Public Custom Event NodeMouseDoubleClick As TreeNodeMouseClickEventHandler " />
<MemberSignature Language="C++ CLI" Value="public:&#xA; event System::Windows::Forms::TreeNodeMouseClickEventHandler ^ NodeMouseDoubleClick;" />
<MemberSignature Language="F#" Value="member this.NodeMouseDoubleClick : System.Windows.Forms.TreeNodeMouseClickEventHandler " Usage="member this.NodeMouseDoubleClick : System.Windows.Forms.TreeNodeMouseClickEventHandler " />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Forms.TreeNodeMouseClickEventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs when the user double-clicks a <see cref="T:System.Windows.Forms.TreeNode" /> with the mouse.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This event occurs when the user double-clicks any part of a tree node with the mouse, including the plus sign (+) or minus sign (-) that indicates whether the node is collapsed or expanded.
For more information about handling events, see [Handling and Raising Events](~/docs/standard/events/index.md).
## Examples
The following code example demonstrates how to handle the <xref:System.Windows.Forms.TreeView.NodeMouseDoubleClick> event and how to use the <xref:System.Windows.Forms.TreeNodeMouseClickEventArgs>. To run this example, paste the code into a Windows Form that contains a <xref:System.Windows.Forms.TreeView> named `treeView1`. Populate `treeView1` with the names of files located in the `c:\` directory of the system the sample is running on, and associate the <xref:System.Windows.Forms.TreeView.NodeMouseDoubleClick> event of `treeView1` with the `treeView1_NodeMouseDoubleClick` method in this example. This example requires that the user has administrator privileges on the machine running the example.
[!code-cpp[System.Windows.Forms.TreeViewWhidbeyMembers#5](~/samples/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.TreeViewWhidbeyMembers/cpp/Form1.cpp#5)]
[!code-csharp[System.Windows.Forms.TreeViewWhidbeyMembers#5](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.TreeViewWhidbeyMembers/CS/Form1.cs#5)]
[!code-vb[System.Windows.Forms.TreeViewWhidbeyMembers#5](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TreeViewWhidbeyMembers/VB/Form1.vb#5)]
]]></format>
</remarks>
<altmember cref="T:System.Windows.Forms.TreeNodeMouseClickEventArgs" />
</Docs>
</Member>
<Member MemberName="NodeMouseHover">
<MemberSignature Language="C#" Value="public event System.Windows.Forms.TreeNodeMouseHoverEventHandler NodeMouseHover;" />
<MemberSignature Language="ILAsm" Value=".event class System.Windows.Forms.TreeNodeMouseHoverEventHandler NodeMouseHover" />
<MemberSignature Language="DocId" Value="E:System.Windows.Forms.TreeView.NodeMouseHover" />
<MemberSignature Language="VB.NET" Value="Public Custom Event NodeMouseHover As TreeNodeMouseHoverEventHandler " />
<MemberSignature Language="C++ CLI" Value="public:&#xA; event System::Windows::Forms::TreeNodeMouseHoverEventHandler ^ NodeMouseHover;" />
<MemberSignature Language="F#" Value="member this.NodeMouseHover : System.Windows.Forms.TreeNodeMouseHoverEventHandler " Usage="member this.NodeMouseHover : System.Windows.Forms.TreeNodeMouseHoverEventHandler " />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Forms.TreeNodeMouseHoverEventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs when the mouse hovers over a <see cref="T:System.Windows.Forms.TreeNode" />.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If the mouse is located over a <xref:System.Windows.Forms.TreeNode>, the <xref:System.Windows.Forms.TreeView.NodeMouseHover> event will occur before the <xref:System.Windows.Forms.Control.MouseHover> event.
For more information about how to handle events, see [Handling and Raising Events](~/docs/standard/events/index.md).
## Examples
The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.TreeView.NodeMouseHover> event. This report helps you learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>.
To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.TreeView> named `TreeView1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.TreeView.NodeMouseHover> event.
[!code-csharp[System.Windows.Forms.EventExamples#634](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/CS/EventExamples.cs#634)]
[!code-vb[System.Windows.Forms.EventExamples#634](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb#634)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Nodes">
<MemberSignature Language="C#" Value="public System.Windows.Forms.TreeNodeCollection Nodes { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Windows.Forms.TreeNodeCollection Nodes" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.TreeView.Nodes" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property Nodes As TreeNodeCollection" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Windows::Forms::TreeNodeCollection ^ Nodes { System::Windows::Forms::TreeNodeCollection ^ get(); };" />
<MemberSignature Language="F#" Value="member this.Nodes : System.Windows.Forms.TreeNodeCollection" Usage="System.Windows.Forms.TreeView.Nodes" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Localizable(true)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.MergableProperty(false)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Content)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Windows.Forms.TreeNodeCollection</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the collection of tree nodes that are assigned to the tree view control.</summary>
<value>A <see cref="T:System.Windows.Forms.TreeNodeCollection" /> that represents the tree nodes assigned to the tree view control.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.TreeView.Nodes%2A> property holds a collection of <xref:System.Windows.Forms.TreeNode> objects, each of which has a <xref:System.Windows.Forms.TreeNode.Nodes%2A> property that can contain its own <xref:System.Windows.Forms.TreeNodeCollection>. This nesting of tree nodes can make it difficult to navigate a tree structure, but the <xref:System.Windows.Forms.TreeNode.FullPath%2A> property makes it easier to determine your location within the tree structure.
## Examples
The following code example displays customer information in a <xref:System.Windows.Forms.TreeView> control. The root tree nodes display customer names, and the child tree nodes display the order numbers assigned to each customer. In this example, 1,000 customers are displayed with 15 orders each. The repainting of the <xref:System.Windows.Forms.TreeView> is suppressed by using the <xref:System.Windows.Forms.TreeView.BeginUpdate%2A> and <xref:System.Windows.Forms.TreeView.EndUpdate%2A> methods, and a wait <xref:System.Windows.Forms.Cursor> is displayed while the <xref:System.Windows.Forms.TreeView> creates and paints the <xref:System.Windows.Forms.TreeNode> objects. This example requires that you have a `Customer` object that can hold a collection of `Order` objects. It also requires that you have created an instance of a <xref:System.Windows.Forms.TreeView> control on a <xref:System.Windows.Forms.Form>.
[!code-cpp[TreeView#1](~/samples/snippets/cpp/VS_Snippets_Winforms/TreeView/CPP/treeview.cpp#1)]
[!code-csharp[TreeView#1](~/samples/snippets/csharp/VS_Snippets_Winforms/TreeView/CS/treeview.cs#1)]
[!code-vb[TreeView#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/TreeView/VB/treeview.vb#1)]
]]></format>
</remarks>
<altmember cref="T:System.Windows.Forms.TreeNodeCollection" />
<altmember cref="P:System.Windows.Forms.TreeView.Nodes" />
</Docs>
</Member>
<Member MemberName="OnAfterCheck">
<MemberSignature Language="C#" Value="protected virtual void OnAfterCheck (System.Windows.Forms.TreeViewEventArgs e);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance void OnAfterCheck(class System.Windows.Forms.TreeViewEventArgs e) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.TreeView.OnAfterCheck(System.Windows.Forms.TreeViewEventArgs)" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Sub OnAfterCheck (e As TreeViewEventArgs)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual void OnAfterCheck(System::Windows::Forms::TreeViewEventArgs ^ e);" />
<MemberSignature Language="F#" Value="abstract member OnAfterCheck : System.Windows.Forms.TreeViewEventArgs -&gt; unit&#xA;override this.OnAfterCheck : System.Windows.Forms.TreeViewEventArgs -&gt; unit" Usage="treeView.OnAfterCheck e" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="e" Type="System.Windows.Forms.TreeViewEventArgs" />
</Parameters>
<Docs>
<param name="e">A <see cref="T:System.Windows.Forms.TreeViewEventArgs" /> that contains the event data.</param>
<summary>Raises the <see cref="E:System.Windows.Forms.TreeView.AfterCheck" /> event.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](~/docs/standard/events/index.md).
The <xref:System.Windows.Forms.TreeView.OnAfterCheck%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
]]></format>
</remarks>
<block subset="none" type="overrides">
<para>When overriding <see cref="M:System.Windows.Forms.TreeView.OnAfterCheck(System.Windows.Forms.TreeViewEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.TreeView.OnAfterCheck(System.Windows.Forms.TreeViewEventArgs)" /> method so that registered delegates receive the event.</para>
</block>
<altmember cref="E:System.Windows.Forms.TreeView.AfterCheck" />
<altmember cref="E:System.Windows.Forms.TreeView.BeforeCheck" />
<altmember cref="M:System.Windows.Forms.TreeView.OnBeforeCheck(System.Windows.Forms.TreeViewCancelEventArgs)" />
</Docs>
</Member>
<Member MemberName="OnAfterCollapse">
<MemberSignature Language="C#" Value="protected internal virtual void OnAfterCollapse (System.Windows.Forms.TreeViewEventArgs e);" FrameworkAlternate="netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
<MemberSignature Language="ILAsm" Value=".method familyorassemblyhidebysig newslot virtual instance void OnAfterCollapse(class System.Windows.Forms.TreeViewEventArgs e) cil managed" FrameworkAlternate="netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.TreeView.OnAfterCollapse(System.Windows.Forms.TreeViewEventArgs)" />
<MemberSignature Language="VB.NET" Value="Protected Friend Overridable Sub OnAfterCollapse (e As TreeViewEventArgs)" FrameworkAlternate="netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
<MemberSignature Language="C++ CLI" Value="protected public:&#xA; virtual void OnAfterCollapse(System::Windows::Forms::TreeViewEventArgs ^ e);" FrameworkAlternate="netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
<MemberSignature Language="F#" Value="abstract member OnAfterCollapse : System.Windows.Forms.TreeViewEventArgs -&gt; unit&#xA;override this.OnAfterCollapse : System.Windows.Forms.TreeViewEventArgs -&gt; unit" Usage="treeView.OnAfterCollapse e" />
<MemberSignature Language="C#" Value="protected virtual void OnAfterCollapse (System.Windows.Forms.TreeViewEventArgs e);" FrameworkAlternate="netframework-1.1" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance void OnAfterCollapse(class System.Windows.Forms.TreeViewEventArgs e) cil managed" FrameworkAlternate="netframework-1.1" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Sub OnAfterCollapse (e As TreeViewEventArgs)" FrameworkAlternate="netframework-1.1" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual void OnAfterCollapse(System::Windows::Forms::TreeViewEventArgs ^ e);" FrameworkAlternate="netframework-1.1" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="e" Type="System.Windows.Forms.TreeViewEventArgs" />
</Parameters>
<Docs>
<param name="e">A <see cref="T:System.Windows.Forms.TreeViewEventArgs" /> that contains the event data.</param>
<summary>Raises the <see cref="E:System.Windows.Forms.TreeView.AfterCollapse" /> event.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](~/docs/standard/events/index.md).
The <xref:System.Windows.Forms.TreeView.OnAfterCollapse%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
]]></format>
</remarks>
<block subset="none" type="overrides">
<para>When overriding <see cref="M:System.Windows.Forms.TreeView.OnAfterCollapse(System.Windows.Forms.TreeViewEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.TreeView.OnAfterCollapse(System.Windows.Forms.TreeViewEventArgs)" /> method so that registered delegates receive the event.</para>
</block>
<altmember cref="E:System.Windows.Forms.TreeView.AfterCollapse" />
<altmember cref="E:System.Windows.Forms.TreeView.BeforeCollapse" />
<altmember cref="M:System.Windows.Forms.TreeView.OnBeforeCollapse(System.Windows.Forms.TreeViewCancelEventArgs)" />
</Docs>
</Member>
<Member MemberName="OnAfterExpand">
<MemberSignature Language="C#" Value="protected virtual void OnAfterExpand (System.Windows.Forms.TreeViewEventArgs e);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance void OnAfterExpand(class System.Windows.Forms.TreeViewEventArgs e) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.TreeView.OnAfterExpand(System.Windows.Forms.TreeViewEventArgs)" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Sub OnAfterExpand (e As TreeViewEventArgs)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual void OnAfterExpand(System::Windows::Forms::TreeViewEventArgs ^ e);" />
<MemberSignature Language="F#" Value="abstract member OnAfterExpand : System.Windows.Forms.TreeViewEventArgs -&gt; unit&#xA;override this.OnAfterExpand : System.Windows.Forms.TreeViewEventArgs -&gt; unit" Usage="treeView.OnAfterExpand e" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="e" Type="System.Windows.Forms.TreeViewEventArgs" />
</Parameters>
<Docs>
<param name="e">A <see cref="T:System.Windows.Forms.TreeViewEventArgs" /> that contains the event data.</param>
<summary>Raises the <see cref="E:System.Windows.Forms.TreeView.AfterExpand" /> event.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](~/docs/standard/events/index.md).
The <xref:System.Windows.Forms.TreeView.OnAfterExpand%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
]]></format>
</remarks>
<block subset="none" type="overrides">
<para>When overriding <see cref="M:System.Windows.Forms.TreeView.OnAfterExpand(System.Windows.Forms.TreeViewEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.TreeView.OnAfterExpand(System.Windows.Forms.TreeViewEventArgs)" /> method so that registered delegates receive the event.</para>
</block>
<altmember cref="E:System.Windows.Forms.TreeView.AfterExpand" />
<altmember cref="E:System.Windows.Forms.TreeView.BeforeExpand" />
<altmember cref="M:System.Windows.Forms.TreeView.OnBeforeExpand(System.Windows.Forms.TreeViewCancelEventArgs)" />
</Docs>
</Member>
<Member MemberName="OnAfterLabelEdit">
<MemberSignature Language="C#" Value="protected virtual void OnAfterLabelEdit (System.Windows.Forms.NodeLabelEditEventArgs e);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance void OnAfterLabelEdit(class System.Windows.Forms.NodeLabelEditEventArgs e) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.TreeView.OnAfterLabelEdit(System.Windows.Forms.NodeLabelEditEventArgs)" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Sub OnAfterLabelEdit (e As NodeLabelEditEventArgs)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual void OnAfterLabelEdit(System::Windows::Forms::NodeLabelEditEventArgs ^ e);" />
<MemberSignature Language="F#" Value="abstract member OnAfterLabelEdit : System.Windows.Forms.NodeLabelEditEventArgs -&gt; unit&#xA;override this.OnAfterLabelEdit : System.Windows.Forms.NodeLabelEditEventArgs -&gt; unit" Usage="treeView.OnAfterLabelEdit e" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="e" Type="System.Windows.Forms.NodeLabelEditEventArgs" />
</Parameters>
<Docs>
<param name="e">A <see cref="T:System.Windows.Forms.NodeLabelEditEventArgs" /> that contains the event data.</param>
<summary>Raises the <see cref="E:System.Windows.Forms.TreeView.AfterLabelEdit" /> event.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](~/docs/standard/events/index.md).
The <xref:System.Windows.Forms.TreeView.OnAfterLabelEdit%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
]]></format>
</remarks>
<block subset="none" type="overrides">
<para>When overriding <see cref="M:System.Windows.Forms.TreeView.OnAfterLabelEdit(System.Windows.Forms.NodeLabelEditEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.TreeView.OnAfterLabelEdit(System.Windows.Forms.NodeLabelEditEventArgs)" /> method so that registered delegates receive the event.</para>
</block>
<altmember cref="E:System.Windows.Forms.TreeView.AfterLabelEdit" />
<altmember cref="E:System.Windows.Forms.TreeView.BeforeLabelEdit" />
<altmember cref="M:System.Windows.Forms.TreeView.OnBeforeLabelEdit(System.Windows.Forms.NodeLabelEditEventArgs)" />
</Docs>
</Member>
<Member MemberName="OnAfterSelect">
<MemberSignature Language="C#" Value="protected virtual void OnAfterSelect (System.Windows.Forms.TreeViewEventArgs e);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance void OnAfterSelect(class System.Windows.Forms.TreeViewEventArgs e) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.TreeView.OnAfterSelect(System.Windows.Forms.TreeViewEventArgs)" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Sub OnAfterSelect (e As TreeViewEventArgs)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual void OnAfterSelect(System::Windows::Forms::TreeViewEventArgs ^ e);" />
<MemberSignature Language="F#" Value="abstract member OnAfterSelect : System.Windows.Forms.TreeViewEventArgs -&gt; unit&#xA;override this.OnAfterSelect : System.Windows.Forms.TreeViewEventArgs -&gt; unit" Usage="treeView.OnAfterSelect e" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="e" Type="System.Windows.Forms.TreeViewEventArgs" />
</Parameters>
<Docs>
<param name="e">A <see cref="T:System.Windows.Forms.TreeViewEventArgs" /> that contains the event data.</param>
<summary>Raises the <see cref="E:System.Windows.Forms.TreeView.AfterSelect" /> event.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](~/docs/standard/events/index.md).
The <xref:System.Windows.Forms.TreeView.OnAfterSelect%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
]]></format>
</remarks>
<block subset="none" type="overrides">
<para>When overriding <see cref="M:System.Windows.Forms.TreeView.OnAfterSelect(System.Windows.Forms.TreeViewEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.TreeView.OnAfterSelect(System.Windows.Forms.TreeViewEventArgs)" /> method so that registered delegates receive the event.</para>
</block>
<altmember cref="E:System.Windows.Forms.TreeView.AfterSelect" />
<altmember cref="E:System.Windows.Forms.TreeView.BeforeSelect" />
<altmember cref="M:System.Windows.Forms.TreeView.OnBeforeSelect(System.Windows.Forms.TreeViewCancelEventArgs)" />
</Docs>
</Member>
<Member MemberName="OnBeforeCheck">
<MemberSignature Language="C#" Value="protected virtual void OnBeforeCheck (System.Windows.Forms.TreeViewCancelEventArgs e);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance void OnBeforeCheck(class System.Windows.Forms.TreeViewCancelEventArgs e) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.TreeView.OnBeforeCheck(System.Windows.Forms.TreeViewCancelEventArgs)" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Sub OnBeforeCheck (e As TreeViewCancelEventArgs)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual void OnBeforeCheck(System::Windows::Forms::TreeViewCancelEventArgs ^ e);" />
<MemberSignature Language="F#" Value="abstract member OnBeforeCheck : System.Windows.Forms.TreeViewCancelEventArgs -&gt; unit&#xA;override this.OnBeforeCheck : System.Windows.Forms.TreeViewCancelEventArgs -&gt; unit" Usage="treeView.OnBeforeCheck e" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="e" Type="System.Windows.Forms.TreeViewCancelEventArgs" />
</Parameters>
<Docs>
<param name="e">A <see cref="T:System.Windows.Forms.TreeViewCancelEventArgs" /> that contains the event data.</param>
<summary>Raises the <see cref="E:System.Windows.Forms.TreeView.BeforeCheck" /> event.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](~/docs/standard/events/index.md).
The <xref:System.Windows.Forms.TreeView.OnBeforeCheck%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
]]></format>
</remarks>
<block subset="none" type="overrides">
<para>When overriding <see cref="M:System.Windows.Forms.TreeView.OnBeforeCheck(System.Windows.Forms.TreeViewCancelEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.TreeView.OnBeforeCheck(System.Windows.Forms.TreeViewCancelEventArgs)" /> method so that registered delegates receive the event.</para>
</block>
<altmember cref="E:System.Windows.Forms.TreeView.BeforeCheck" />
<altmember cref="E:System.Windows.Forms.TreeView.AfterCheck" />
<altmember cref="M:System.Windows.Forms.TreeView.OnAfterCheck(System.Windows.Forms.TreeViewEventArgs)" />
</Docs>
</Member>
<Member MemberName="OnBeforeCollapse">
<MemberSignature Language="C#" Value="protected internal virtual void OnBeforeCollapse (System.Windows.Forms.TreeViewCancelEventArgs e);" FrameworkAlternate="netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
<MemberSignature Language="ILAsm" Value=".method familyorassemblyhidebysig newslot virtual instance void OnBeforeCollapse(class System.Windows.Forms.TreeViewCancelEventArgs e) cil managed" FrameworkAlternate="netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.TreeView.OnBeforeCollapse(System.Windows.Forms.TreeViewCancelEventArgs)" />
<MemberSignature Language="VB.NET" Value="Protected Friend Overridable Sub OnBeforeCollapse (e As TreeViewCancelEventArgs)" FrameworkAlternate="netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
<MemberSignature Language="C++ CLI" Value="protected public:&#xA; virtual void OnBeforeCollapse(System::Windows::Forms::TreeViewCancelEventArgs ^ e);" FrameworkAlternate="netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
<MemberSignature Language="F#" Value="abstract member OnBeforeCollapse : System.Windows.Forms.TreeViewCancelEventArgs -&gt; unit&#xA;override this.OnBeforeCollapse : System.Windows.Forms.TreeViewCancelEventArgs -&gt; unit" Usage="treeView.OnBeforeCollapse e" />
<MemberSignature Language="C#" Value="protected virtual void OnBeforeCollapse (System.Windows.Forms.TreeViewCancelEventArgs e);" FrameworkAlternate="netframework-1.1" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance void OnBeforeCollapse(class System.Windows.Forms.TreeViewCancelEventArgs e) cil managed" FrameworkAlternate="netframework-1.1" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Sub OnBeforeCollapse (e As TreeViewCancelEventArgs)" FrameworkAlternate="netframework-1.1" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual void OnBeforeCollapse(System::Windows::Forms::TreeViewCancelEventArgs ^ e);" FrameworkAlternate="netframework-1.1" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="e" Type="System.Windows.Forms.TreeViewCancelEventArgs" />
</Parameters>
<Docs>
<param name="e">A <see cref="T:System.Windows.Forms.TreeViewCancelEventArgs" /> that contains the event data.</param>
<summary>Raises the <see cref="E:System.Windows.Forms.TreeView.BeforeCollapse" /> event.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](~/docs/standard/events/index.md).
The <xref:System.Windows.Forms.TreeView.OnBeforeCollapse%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
]]></format>
</remarks>
<block subset="none" type="overrides">
<para>When overriding <see cref="M:System.Windows.Forms.TreeView.OnBeforeCollapse(System.Windows.Forms.TreeViewCancelEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.TreeView.OnBeforeCollapse(System.Windows.Forms.TreeViewCancelEventArgs)" /> method so that registered delegates receive the event.</para>
</block>
<altmember cref="E:System.Windows.Forms.TreeView.BeforeCollapse" />
<altmember cref="E:System.Windows.Forms.TreeView.AfterCollapse" />
<altmember cref="M:System.Windows.Forms.TreeView.OnAfterCollapse(System.Windows.Forms.TreeViewEventArgs)" />
</Docs>
</Member>
<Member MemberName="OnBeforeExpand">
<MemberSignature Language="C#" Value="protected virtual void OnBeforeExpand (System.Windows.Forms.TreeViewCancelEventArgs e);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance void OnBeforeExpand(class System.Windows.Forms.TreeViewCancelEventArgs e) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.TreeView.OnBeforeExpand(System.Windows.Forms.TreeViewCancelEventArgs)" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Sub OnBeforeExpand (e As TreeViewCancelEventArgs)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual void OnBeforeExpand(System::Windows::Forms::TreeViewCancelEventArgs ^ e);" />
<MemberSignature Language="F#" Value="abstract member OnBeforeExpand : System.Windows.Forms.TreeViewCancelEventArgs -&gt; unit&#xA;override this.OnBeforeExpand : System.Windows.Forms.TreeViewCancelEventArgs -&gt; unit" Usage="treeView.OnBeforeExpand e" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="e" Type="System.Windows.Forms.TreeViewCancelEventArgs" />
</Parameters>
<Docs>
<param name="e">A <see cref="T:System.Windows.Forms.TreeViewCancelEventArgs" /> that contains the event data.</param>
<summary>Raises the <see cref="E:System.Windows.Forms.TreeView.BeforeExpand" /> event.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](~/docs/standard/events/index.md).
The <xref:System.Windows.Forms.TreeView.OnBeforeExpand%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
]]></format>
</remarks>
<block subset="none" type="overrides">
<para>When overriding <see cref="M:System.Windows.Forms.TreeView.OnBeforeExpand(System.Windows.Forms.TreeViewCancelEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.TreeView.OnBeforeExpand(System.Windows.Forms.TreeViewCancelEventArgs)" /> method so that registered delegates receive the event.</para>
</block>
<altmember cref="E:System.Windows.Forms.TreeView.BeforeExpand" />
<altmember cref="E:System.Windows.Forms.TreeView.AfterExpand" />
<altmember cref="M:System.Windows.Forms.TreeView.OnAfterExpand(System.Windows.Forms.TreeViewEventArgs)" />
</Docs>
</Member>
<Member MemberName="OnBeforeLabelEdit">
<MemberSignature Language="C#" Value="protected virtual void OnBeforeLabelEdit (System.Windows.Forms.NodeLabelEditEventArgs e);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance void OnBeforeLabelEdit(class System.Windows.Forms.NodeLabelEditEventArgs e) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.TreeView.OnBeforeLabelEdit(System.Windows.Forms.NodeLabelEditEventArgs)" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Sub OnBeforeLabelEdit (e As NodeLabelEditEventArgs)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual void OnBeforeLabelEdit(System::Windows::Forms::NodeLabelEditEventArgs ^ e);" />
<MemberSignature Language="F#" Value="abstract member OnBeforeLabelEdit : System.Windows.Forms.NodeLabelEditEventArgs -&gt; unit&#xA;override this.OnBeforeLabelEdit : System.Windows.Forms.NodeLabelEditEventArgs -&gt; unit" Usage="treeView.OnBeforeLabelEdit e" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="e" Type="System.Windows.Forms.NodeLabelEditEventArgs" />
</Parameters>
<Docs>
<param name="e">A <see cref="T:System.Windows.Forms.NodeLabelEditEventArgs" /> that contains the event data.</param>
<summary>Raises the <see cref="E:System.Windows.Forms.TreeView.BeforeLabelEdit" /> event.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](~/docs/standard/events/index.md).
The <xref:System.Windows.Forms.TreeView.OnBeforeLabelEdit%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
]]></format>
</remarks>
<block subset="none" type="overrides">
<para>When overriding <see cref="M:System.Windows.Forms.TreeView.OnBeforeLabelEdit(System.Windows.Forms.NodeLabelEditEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.TreeView.OnBeforeLabelEdit(System.Windows.Forms.NodeLabelEditEventArgs)" /> method so that registered delegates receive the event.</para>
</block>
<altmember cref="E:System.Windows.Forms.TreeView.BeforeLabelEdit" />
<altmember cref="E:System.Windows.Forms.TreeView.AfterLabelEdit" />
<altmember cref="M:System.Windows.Forms.TreeView.OnAfterLabelEdit(System.Windows.Forms.NodeLabelEditEventArgs)" />
</Docs>
</Member>
<Member MemberName="OnBeforeSelect">
<MemberSignature Language="C#" Value="protected virtual void OnBeforeSelect (System.Windows.Forms.TreeViewCancelEventArgs e);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance void OnBeforeSelect(class System.Windows.Forms.TreeViewCancelEventArgs e) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.TreeView.OnBeforeSelect(System.Windows.Forms.TreeViewCancelEventArgs)" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Sub OnBeforeSelect (e As TreeViewCancelEventArgs)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual void OnBeforeSelect(System::Windows::Forms::TreeViewCancelEventArgs ^ e);" />
<MemberSignature Language="F#" Value="abstract member OnBeforeSelect : System.Windows.Forms.TreeViewCancelEventArgs -&gt; unit&#xA;override this.OnBeforeSelect : System.Windows.Forms.TreeViewCancelEventArgs -&gt; unit" Usage="treeView.OnBeforeSelect e" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="e" Type="System.Windows.Forms.TreeViewCancelEventArgs" />
</Parameters>
<Docs>
<param name="e">A <see cref="T:System.Windows.Forms.TreeViewCancelEventArgs" /> that contains the event data.</param>
<summary>Raises the <see cref="E:System.Windows.Forms.TreeView.BeforeSelect" /> event.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](~/docs/standard/events/index.md).
The <xref:System.Windows.Forms.TreeView.OnBeforeSelect%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
]]></format>
</remarks>
<block subset="none" type="overrides">
<para>When overriding <see cref="M:System.Windows.Forms.TreeView.OnBeforeSelect(System.Windows.Forms.TreeViewCancelEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.TreeView.OnBeforeSelect(System.Windows.Forms.TreeViewCancelEventArgs)" /> method so that registered delegates receive the event.</para>
</block>
<altmember cref="E:System.Windows.Forms.TreeView.BeforeSelect" />
<altmember cref="E:System.Windows.Forms.TreeView.AfterSelect" />
<altmember cref="M:System.Windows.Forms.TreeView.OnAfterSelect(System.Windows.Forms.TreeViewEventArgs)" />
</Docs>
</Member>
<Member