System.Windows.Forms
1.0.5000.0
2.0.0.0
System.MarshalByRefObject
System.ICloneable
System.Runtime.Serialization.ISerializable
System.ComponentModel.TypeConverter(typeof(System.Windows.Forms.TreeNodeConverter))
System.ComponentModel.DefaultProperty("Text")
The collection holds all the child objects assigned to the current . You can add, remove, or clone a ; when you do this, all child tree nodes are added, removed, or cloned. Each can contain a collection of other objects. This can make it difficult to determine where you are in the when iterating through the collection. To determine your location in a tree structure, use the property. The string can be parsed using the string value to determine where a label begins and ends.
The label is set by setting the property explicitly. The alternative is to create the tree node using one of the constructors that has a string parameter that represents the property. The label is displayed next to the image, if one is displayed.
To display images next to the tree nodes, assign an to the property of the parent control and assign an by referencing its index value in the property. Set the property to the index value of the you want to display when the is in an unselected state. Likewise, set the property to the index value of the you want to display when the is selected.
Selecting specific tree nodes and iterating through the collection can be achieved by using the following property values: , , , , , . Assign the returned by one of aforementioned properties to the property to select that tree node in the control.
Tree nodes can be expanded to display the next level of child tree nodes. The user can expand the by pressing the plus (+) button next to the , if one is displayed, or you can expand the by calling the method. To expand all child tree node levels in the collection, call the method. You can collapse the child level by calling the method, or the user can press the minus (-) button next to the , if one is displayed. You can also call the method to alternate the between the expanded and collapsed states.
Tree nodes can optionally display a check box. To display the check boxes, set the property of the to true. The property is set to true for tree nodes that are in a checked state.
Represents a node of a .
Constructor
To be added.
Initializes a new instance of the class.
1.0.5000.0
2.0.0.0
Constructor
The parameter value is assigned to the node's property and becomes the tree node label.
Initializes a new instance of the class with the specified label text.
The label of the new tree node.
1.0.5000.0
2.0.0.0
Constructor
2.0.0.0
To be added.
Initializes a new instance of the class using the specified serialization information and context.
The that contains the data to deserialize the class.
The that contains the source and destination of the serialized stream.
Constructor
The parameter value is assigned to the node's property and becomes the tree node label. The tree nodes that are contained in the array are added to the that is stored in the property.
Initializes a new instance of the class with the specified label text and child tree nodes.
The label of the new tree node.
An array of child objects.
1.0.5000.0
2.0.0.0
Constructor
The parameter value is assigned to the node's property and becomes the tree node label. The and values are the index values of an stored in the assigned to the property. The image referenced in the property is displayed when the tree node is not selected. Likewise, the image referenced in the property is displayed when the tree node is in a selected state.
Initializes a new instance of the class with the specified label text and images to display when the tree node is in a selected and unselected state.
The label of the new tree node.
The index value of to display when the tree node is unselected.
The index value of to display when the tree node is selected.
1.0.5000.0
2.0.0.0
Constructor
The parameter value is assigned to the node's property and becomes the tree node label. The and values are the index values of an stored in the assigned to the property. The image referenced in the parameter is displayed when the tree node is not selected. Likewise, the image referenced in the parameter is displayed when the tree node is in a selected state. The tree nodes that are contained in the array are added to the that is stored in the property.
Initializes a new instance of the class with the specified label text, child tree nodes, and images to display when the tree node is in a selected and unselected state.
The label of the new tree node.
The index value of to display when the tree node is unselected.
The index value of to display when the tree node is selected.
An array of child objects.
1.0.5000.0
2.0.0.0
Property
System.Drawing.Color
To be added.
If the property is set to , the used is the property value of the control that the tree node is assigned to.
Gets or sets the background color of the tree node.
1.0.5000.0
2.0.0.0
Method
System.Void
A typical scenario to use this method is to call it on the event of a or .
This method only works if the property of the is set to true. If is set to false, an exception is thrown and the tree node will not be put into an editable state.
Initiates the editing of the tree node label.
1.0.5000.0
2.0.0.0
Property
System.Drawing.Rectangle
To be added.
The coordinates are relative to the upper-left corner of the control.
Gets the bounds of the tree node.
1.0.5000.0
2.0.0.0
System.ComponentModel.Browsable(false)
Property
System.Boolean
To be added.
To be added.
Gets or sets a value indicating whether the tree node is in a checked state.
1.0.5000.0
2.0.0.0
System.ComponentModel.DefaultValue(false)
Method
System.Object
The tree structure from the tree node being cloned and below is copied. Any child tree nodes assigned to the being cloned are included in the new tree node and subtree.
The method performs a shallow copy of the node. If the value of the property is a reference type, both the original and cloned copy will point to the same single instance of the value.
Copies the tree node and the entire subtree rooted at this tree node.
The that represents the cloned .
1.0.5000.0
2.0.0.0
Method
System.Void
The method collapses the current and its child nodes. If you want to collapse only the current , use the overload, passing true to ignore its child nodes.
The state of a is persisted. For example, if the next level of child nodes was not collapsed previously, when the method is called, the child nodes appear in their previously expanded state.
Collapses the tree node.
1.0.5000.0
2.0.0.0
Method
2.0.0.0
System.Void
Use the method, passing true, when you want to collapse a node but leave its child nodes in their expanded state.
Collapses the and optionally collapses its children.
true to leave the child nodes in their current state; false to collapse the child nodes.
Property
2.0.0.0
System.ComponentModel.DefaultValue(null)
System.Windows.Forms.ContextMenu
To be added.
The preferred way to associate a shortcut menu with a tree node is with the property.
Gets the shortcut menu that is associated with this tree node.
Property
2.0.0.0
System.ComponentModel.DefaultValue(null)
System.Windows.Forms.ContextMenuStrip
To be added.
The shortcut menu is shown when the user right-clicks the tree node.
Gets or sets the shortcut menu associated with this tree node.
Method
2.0.0.0
System.Void
To be added.
Loads the state of the from the specified .
The that describes the .
The that indicates the state of the stream during deserialization.
Method
System.Void
To be added.
Ends the editing of the tree node label.
true if the editing of the tree node label text was canceled without being saved; otherwise, false.
1.0.5000.0
2.0.0.0
Method
System.Void
When the method is called, the tree is expanded and scrolled to ensure that the current tree node is visible in the . This method is useful if you are selecting a tree node in code based on certain criteria. By calling this method after you select the node, the user can see and interact with the selected node.
If the property is set to a value that is larger than the height of the tree view control, calling this method has unexpected results.
Ensures that the tree node is visible, expanding tree nodes and scrolling the tree view control as necessary.
1.0.5000.0
2.0.0.0
Method
System.Void
The method expands the current down to the next level of nodes.
The state of a is persisted. For example, if the next level of child nodes was not collapsed previously, when the method is called, the child nodes appear in their previously expanded state.
Expands the tree node.
1.0.5000.0
2.0.0.0
Method
System.Void
The method expands all the child tree nodes assigned to the collection.
The state of a is persisted. For example, if the next level of child nodes was not collapsed previously, when the method is called, the child nodes appear in their previously expanded state.
Expands all the child tree nodes.
1.0.5000.0
2.0.0.0
Property
System.Windows.Forms.TreeNode
To be added.
The is the first child in the stored in the property of the current tree node. If the has no child tree node, the property returns null.
Gets the first child tree node in the tree node collection.
1.0.5000.0
2.0.0.0
System.ComponentModel.Browsable(false)
Property
System.Drawing.Color
To be added.
If null, the used is the property value of the control that the tree node is assigned to.
Gets or sets the foreground color of the tree node.
1.0.5000.0
2.0.0.0
Method
System.Windows.Forms.TreeNode
When a node is added to the collection, the control sends an NM_CUSTOMDRAW notification before the node handle is available. If you override the method of the to provide custom drawing in response to this notification, you should always check the return value of this method for null before you attempt to access the node.
Returns the tree node with the specified handle and assigned to the specified tree view control.
A that represents the tree node assigned to the specified control with the specified handle.
The that contains the tree node.
The handle of the tree node.
1.0.5000.0
2.0.0.0
Property
System.String
To be added.
The path consists of the labels of all the tree nodes that must be navigated to reach this tree node, starting at the root tree node. The node labels are separated by the delimiter character specified in the property of the control that contains this node. For example, if the delimiter character of the tree view control named "Location" is set to the backslash character, (\), the property value is "Country\Region\State".
Gets the path from the root tree node to the current tree node.
1.0.5000.0
2.0.0.0
System.ComponentModel.Browsable(false)
Method
System.Int32
To be added.
Returns the number of child tree nodes.
The number of child tree nodes assigned to the collection.
true if the resulting count includes all tree nodes indirectly rooted at this tree node; otherwise, false.
1.0.5000.0
2.0.0.0
Property
System.IntPtr
To be added.
If a handle is not already created when the property is referenced, it is created.
Gets the handle of the tree node.
1.0.5000.0
2.0.0.0
System.ComponentModel.Browsable(false)
Property
System.ComponentModel.Localizable(true)
System.ComponentModel.Editor("System.Windows.Forms.Design.ImageIndexEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(System.Drawing.Design.UITypeEditor))
System.ComponentModel.RefreshProperties(System.ComponentModel.RefreshProperties.Repaint)
System.ComponentModel.TypeConverter(typeof(System.Windows.Forms.TreeViewImageIndexConverter))
System.Windows.Forms.RelatedImageList("TreeView.ImageList")
System.ComponentModel.DefaultValue(-1)
System.Int32
To be added.
The value is the index value of an stored in the assigned to the property.
The default value of the property is the same as the property of the control that the is assigned to.
The and properties are mutually exclusive; therefore, if one property is set, the other is ignored. If you set the property, the property is automatically set to -1. Alternatively, if you set , is automatically set to an empty string ("").
Gets or sets the image list index value of the image displayed when the tree node is in the unselected state.
1.0.5000.0
2.0.0.0
Property
2.0.0.0
System.ComponentModel.Editor("System.Windows.Forms.Design.ImageIndexEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(System.Drawing.Design.UITypeEditor))
System.ComponentModel.RefreshProperties(System.ComponentModel.RefreshProperties.Repaint)
System.ComponentModel.TypeConverter(typeof(System.Windows.Forms.TreeViewImageKeyConverter))
System.Windows.Forms.RelatedImageList("TreeView.ImageList")
System.ComponentModel.DefaultValue("")
System.ComponentModel.Localizable(true)
System.String
To be added.
The image key returned by this property is contained in the property of the containing control.
The is case-insensitive.
The and properties are mutually exclusive; if one property is set, the other is ignored. If you set the property, the property is automatically set to -1. Alternatively, if you set , is automatically set to an empty string ("").
Gets or sets the key for the image associated with this tree node when the node is in an unselected state.
Property
System.Int32
To be added.
To be added.
Gets the position of the tree node in the tree node collection.
1.0.5000.0
2.0.0.0
Property
System.Boolean
To be added.
To be added.
Gets a value indicating whether the tree node is in an editable state.
1.0.5000.0
2.0.0.0
System.ComponentModel.Browsable(false)
Property
System.Boolean
To be added.
To be added.
Gets a value indicating whether the tree node is in the expanded state.
1.0.5000.0
2.0.0.0
System.ComponentModel.Browsable(false)
Property
System.Boolean
To be added.
To be added.
Gets a value indicating whether the tree node is in the selected state.
1.0.5000.0
2.0.0.0
System.ComponentModel.Browsable(false)
Property
System.Boolean
To be added.
To be added.
Gets a value indicating whether the tree node is visible or partially visible.
1.0.5000.0
2.0.0.0
System.ComponentModel.Browsable(false)
Property
System.Windows.Forms.TreeNode
To be added.
The is the last child in the stored in the property of the current tree node. If the has no child tree node, the property returns null.
Gets the last child tree node.
1.0.5000.0
2.0.0.0
System.ComponentModel.Browsable(false)
Property
2.0.0.0
System.ComponentModel.Browsable(false)
System.Int32
To be added.
For the property, the root node is considered the first level of nesting and returns 0.
Gets the zero-based depth of the tree node in the control.
Property
2.0.0.0
System.String
To be added.
The of a is also the node's key, when the node is part of a . If the node does not have a name, returns an empty string ("").
Gets or sets the name of the tree node.
Property
System.Windows.Forms.TreeNode
To be added.
The is the next sibling in the stored in the property of the tree node's parent . If there is no next tree node, the property returns null.
Gets the next sibling tree node.
1.0.5000.0
2.0.0.0
System.ComponentModel.Browsable(false)
Property
System.Windows.Forms.TreeNode
To be added.
The can be a child, sibling, or a tree node from another branch. If there is no next tree node, the property returns null.
Gets the next visible tree node.
1.0.5000.0
2.0.0.0
System.ComponentModel.Browsable(false)
Property
System.ComponentModel.Localizable(true)
System.ComponentModel.DefaultValue(null)
System.Drawing.Font
To be added.
If null, the used is the property value of the control that this node is attached to.
If the node font is larger than the property value that is set in the control, the tree node label text is clipped.
Gets or sets the font that is used to display the text on the tree node label.
1.0.5000.0
2.0.0.0
Property
System.ComponentModel.ListBindable(false)
System.ComponentModel.Browsable(false)
System.Windows.Forms.TreeNodeCollection
To be added.
The property can hold a collection of other objects. Each of the tree node in the collection has a property that can contain its own . This nesting of tree nodes can make it difficult to navigate a tree structure. The property makes it easier to determine your location in a tree.
Gets the collection of objects assigned to the current tree node.
1.0.5000.0
2.0.0.0
Property
System.Windows.Forms.TreeNode
To be added.
If the tree node is at the root level, the property returns null.
Gets the parent tree node of the current tree node.
1.0.5000.0
2.0.0.0
System.ComponentModel.Browsable(false)
Property
System.Windows.Forms.TreeNode
To be added.
The is the previous sibling in the stored in the property of the tree node's parent . If there is no previous tree node, the property returns null.
Gets the previous sibling tree node.
1.0.5000.0
2.0.0.0
System.ComponentModel.Browsable(false)
Property
System.Windows.Forms.TreeNode
To be added.
The can be a child, sibling, or a tree node from another branch. If there is no previous tree node, the property returns null.
Gets the previous visible tree node.
1.0.5000.0
2.0.0.0
System.ComponentModel.Browsable(false)
Method
System.Void
When the method is called, the tree node, and any child tree nodes that are assigned to the , are removed from the . The removed child nodes are removed from the but are still attached to this tree node.
Removes the current tree node from the tree view control.
1.0.5000.0
2.0.0.0
Property
System.ComponentModel.Localizable(true)
System.ComponentModel.Editor("System.Windows.Forms.Design.ImageIndexEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(System.Drawing.Design.UITypeEditor))
System.ComponentModel.RefreshProperties(System.ComponentModel.RefreshProperties.Repaint)
System.ComponentModel.TypeConverter(typeof(System.Windows.Forms.TreeViewImageIndexConverter))
System.Windows.Forms.RelatedImageList("TreeView.ImageList")
System.ComponentModel.DefaultValue(-1)
System.Int32
To be added.
The value is the index value of an stored in the assigned to the property.
The default value of the property is the same as the property of the control that the is assigned to.
Gets or sets the image list index value of the image that is displayed when the tree node is in the selected state.
1.0.5000.0
2.0.0.0
Property
2.0.0.0
System.ComponentModel.Editor("System.Windows.Forms.Design.ImageIndexEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(System.Drawing.Design.UITypeEditor))
System.ComponentModel.RefreshProperties(System.ComponentModel.RefreshProperties.Repaint)
System.ComponentModel.TypeConverter(typeof(System.Windows.Forms.TreeViewImageKeyConverter))
System.Windows.Forms.RelatedImageList("TreeView.ImageList")
System.ComponentModel.DefaultValue("")
System.ComponentModel.Localizable(true)
System.String
To be added.
The image key returned by this property is contained in the property of the parent control.
Gets or sets the key of the image displayed in the tree node when it is in a selected state.
Method
2.0.0.0
System.Void
To be added.
Saves the state of the to the specified .
The that describes the .
The that indicates the state of the stream during serialization
Property
2.0.0.0
System.ComponentModel.Editor("System.Windows.Forms.Design.ImageIndexEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(System.Drawing.Design.UITypeEditor))
System.ComponentModel.RefreshProperties(System.ComponentModel.RefreshProperties.Repaint)
System.ComponentModel.TypeConverter(typeof(System.Windows.Forms.NoneExcludedImageIndexConverter))
System.Windows.Forms.RelatedImageList("TreeView.StateImageList")
System.ComponentModel.DefaultValue(-1)
System.ComponentModel.Localizable(true)
System.Int32
To be added.
The image index that is returned by this property is contained in the property of the parent control.
If the parent has check boxes enabled, the is ignored and the node will display the first or second image in the set on the parent to indicate an unchecked or checked state, respectively. Toggling the property does not affect the value of the .
The returns -1 when not set. The and properties are mutually exclusive, meaning if one is set, the other is ignored. If you set the property, the property is automatically set to -1. Alternatively, if you set , is automatically set to an empty string ("").
Gets or sets the index of the image that is used to indicate the state of the when the parent has its property set to false.
Property
2.0.0.0
System.ComponentModel.Editor("System.Windows.Forms.Design.ImageIndexEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(System.Drawing.Design.UITypeEditor))
System.ComponentModel.RefreshProperties(System.ComponentModel.RefreshProperties.Repaint)
System.ComponentModel.TypeConverter(typeof(System.Windows.Forms.ImageKeyConverter))
System.Windows.Forms.RelatedImageList("TreeView.StateImageList")
System.ComponentModel.DefaultValue("")
System.ComponentModel.Localizable(true)
System.String
To be added.
The image key that is returned by this property is contained in the property of the parent control.
If the parent has check boxes enabled, the is ignored and the node will display the first or second image in the set on the parent to indicate an unchecked or checked state, respectively. Toggling the property does not affect the value of the .
The and properties are mutually exclusive, meaning if one is set, the other is ignored. If you set the property, the property is automatically set to -1. Alternatively, if you set , is automatically set to an empty string (""). You should set the to an image with a corresponding index between 0 and 14. You can set the to an image with an index value greater than 14 (an exception will not be thrown), but the image may not be displayed
Gets or sets the key of the image that is used to indicate the state of the when the parent has its property set to false.
Method
1.0.5000.0
2.0.0.0
System.Void
To be added.
Populates a serialization information object with the data needed to serialize the .
A that contains the data to serialize the .
A that contains the destination information for this serialization.
Property
System.ComponentModel.DefaultValue(null)
System.ComponentModel.TypeConverter(typeof(System.ComponentModel.StringConverter))
System.ComponentModel.Localizable(false)
System.ComponentModel.Bindable(true)
System.Object
To be added.
Any derived type can be assigned to this property. If this property is being set through the Windows Forms designer, only text can be assigned.
The method performs a shallow copy of the node. If the value of the property is a reference type, both the original and cloned copy will point to the same single instance of the value.
Gets or sets the object that contains data about the tree node.
1.0.5000.0
2.0.0.0
Property
System.ComponentModel.Localizable(true)
System.String
To be added.
The maximum number of characters that a can display is 259. If a that has more than 259 characters is assigned to this property, only the first 259 characters are displayed.
This property cannot be set by the user if the property of the parent is set to false. The alternative to explicitly setting this property is to create the tree node by using one of the constructors that has a string parameter that represents the property. The label is displayed next to the image, if one is displayed.
Gets or sets the text displayed in the label of the tree node.
1.0.5000.0
2.0.0.0
Method
System.Void
The tree node is toggled to the state opposite its current state, either expanded or collapsed.
The state of a is persisted. For example, if the next level of child nodes was not collapsed previously, when the method is called, the child nodes appear in their previously expanded state.
Toggles the tree node to either the expanded or collapsed state.
1.0.5000.0
2.0.0.0
Property
2.0.0.0
System.ComponentModel.Localizable(false)
System.ComponentModel.DefaultValue("")
System.String
To be added.
You must set the property of the parent to true for the to be visible at run time.
If the control has a ToolTip and also contains a that has a , only the for the node will be shown.
Gets or sets the text that appears when the mouse pointer hovers over a .
Method
System.String
To be added.
To be added.
To be added.
1.0.5000.0
2.0.0.0
Property
System.Windows.Forms.TreeView
To be added.
To be added.
Gets the parent tree view that the tree node is assigned to.
1.0.5000.0
2.0.0.0
System.ComponentModel.Browsable(false)