Share via


ContextNode.MoveSubNodeToPosition Method

Reorders a specified child ContextNode object so that it moves to the specified index.

Namespace:  System.Windows.Ink
Assembly:  IAWinFX (in IAWinFX.dll)

Syntax

'Declaration
Public Sub MoveSubNodeToPosition ( _
    subNodeToMove As ContextNode, _
    newIndex As Integer _
)
'Usage
Dim instance As ContextNode 
Dim subNodeToMove As ContextNode 
Dim newIndex As Integer

instance.MoveSubNodeToPosition(subNodeToMove, _
    newIndex)
public void MoveSubNodeToPosition(
    ContextNode subNodeToMove,
    int newIndex
)
public:
void MoveSubNodeToPosition(
    ContextNode^ subNodeToMove, 
    int newIndex
)
public function MoveSubNodeToPosition(
    subNodeToMove : ContextNode, 
    newIndex : int
)

Parameters

Remarks

An ArgumentException is thrown if nodeToMove is not a child of the ContextNode object.

Examples

The following example moves an InkWordNode, wordToMove, from its current index in a line to one index earlier. This code could be part of a text correction user interface where the user indicates that a selected word should have been placed one word earlier.

Dim parentNode As ContextNode = wordToMove.ParentNode
Dim wordIndex As Integer = parentNode.SubNodes.IndexOf(wordToMove)
Dim newIndex As Integer = Math.Max(0, wordIndex - 1)
parentNode.MoveSubNodeToPosition(wordToMove, newIndex)
ContextNode parentNode = wordToMove.ParentNode;
int wordIndex = parentNode.SubNodes.IndexOf(wordToMove);
int newIndex = Math.Max(0, wordIndex - 1);
parentNode.MoveSubNodeToPosition(wordToMove, newIndex);

Platforms

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Version Information

.NET Framework

Supported in: 3.0

See Also

Reference

ContextNode Class

ContextNode Members

System.Windows.Ink Namespace