Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Sets the ___location of a non-ink word on the application document.
Namespace: System.Windows.Ink
Assembly: IAWinFX (in IAWinFX.dll)
Syntax
'Declaration
Public Sub SetLocation ( _
___location As AnalysisRegion _
)
'Usage
Dim instance As TextWordNode
Dim ___location As AnalysisRegion
instance.SetLocation(___location)
public void SetLocation(
AnalysisRegion ___location
)
public:
void SetLocation(
AnalysisRegion^ ___location
)
public function SetLocation(
___location : AnalysisRegion
)
Parameters
- ___location
Type: System.Windows.Ink.AnalysisRegion
Examples
The following example adds a TextWordNode object to an InkAnalyzer named theInkAnalyzer, for a TextBox control named theTextBox. It sets the Data property of the TextWordNode object to the Text property of the TextBox.
' Add nodes to hold the TextWordNode
Dim writingRegion As WritingRegionNode = _
CType(theInkAnalyzer.RootNode.CreateSubNode(ContextNodeType.WritingRegion), _
WritingRegionNode)
Dim paragraph As ParagraphNode = _
CType(writingRegion.CreateSubNode(ContextNodeType.Paragraph), _
ParagraphNode)
Dim line As LineNode = _
CType(paragraph.CreateSubNode(ContextNodeType.Line), LineNode)
' Create node for the word
Dim textWord As TextWordNode = _
CType(line.CreateSubNode(ContextNodeType.TextWord), TextWordNode)
' Set ___location
Dim textTop As Double = InkCanvas.GetTop(theTextBox)
Dim textLeft As Double = InkCanvas.GetLeft(theTextBox)
Dim rectLocation As New Rect(textLeft, textTop, theTextBox.Width, theTextBox.Height)
textWord.SetLocation(New AnalysisRegion(rectLocation))
' Set the data property to be the text in the textbox.
textWord.Data = theTextBox.Text
// Add nodes to hold the TextWordNode
WritingRegionNode writingRegion = (WritingRegionNode)
theInkAnalyzer.RootNode.CreateSubNode(ContextNodeType.WritingRegion);
ParagraphNode paragraph = (ParagraphNode)
writingRegion.CreateSubNode(ContextNodeType.Paragraph);
LineNode line = (LineNode)
paragraph.CreateSubNode(ContextNodeType.Line);
// Create node for the word
TextWordNode textWord = (TextWordNode)
line.CreateSubNode(ContextNodeType.TextWord);
// Set ___location
double textTop = InkCanvas.GetTop(theTextBox);
double textLeft = InkCanvas.GetLeft(theTextBox);
Rect rectLocation = new Rect(textLeft, textTop, theTextBox.Width, theTextBox.Height);
textWord.SetLocation(new AnalysisRegion(rectLocation));
// Set the data property to be the text in the textbox.
textWord.Data = theTextBox.Text;
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