Compartir a través de


ContextNode.ParentNode Property

Gets the parent node of the ContextNode in the context node tree.

Namespace: Microsoft.Ink
Assembly: Microsoft.Ink.Analysis (in microsoft.ink.analysis.dll)

Syntax

'Declaration
Public ReadOnly Property ParentNode As ContextNode
'Usage
Dim instance As ContextNode
Dim value As ContextNode

value = instance.ParentNode
public ContextNode ParentNode { get; }
public:
property ContextNode^ ParentNode {
    ContextNode^ get ();
}
/** @property */
public ContextNode get_ParentNode ()
public function get ParentNode () : ContextNode
Not applicable.

Property Value

The parent node of the ContextNode.

Remarks

Returns a null reference (Nothing in Visual Basic) if this is the RootNode.

Example

This example uses a System.Windows.Forms.TreeViewSystem.Windows.Forms.TreeView, theTreeView, where each TreeNodeTreeNode has its Tag property set to a ContextNode. It finds the selected node and then uses ParentNode to find its parent. After the parent node is found, it calls the MarkNodeAsRed method to change the node's strokes to red.

Dim selectedNode As ContextNode = CType(Me.theTreeView.SelectedNode.Tag, ContextNode)
Dim parentNode As ContextNode = selectedNode.ParentNode
If Not (parentNode Is Nothing) Then
    MarkNodeAsRed(parentNode)
End If
ContextNode selectedNode = (ContextNode) this.theTreeView.SelectedNode.Tag;
ContextNode parentNode = selectedNode.ParentNode;
if (parentNode != null)
{
    MarkNodeAsRed(parentNode);
}

Platforms

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

Version Information

.NET Framework

Supported in: 3.0

See Also

Reference

ContextNode Class
ContextNode Members
Microsoft.Ink Namespace
ContextNode.SubNodes