设置非墨迹单词在应用程序文档上的位置。
命名空间:  System.Windows.Ink
程序集:  IAWinFX(在 IAWinFX.dll 中)
语法
声明
Public Sub SetLocation ( _
    location As AnalysisRegion _
)
用法
Dim instance As TextWordNode
Dim location As AnalysisRegion
instance.SetLocation(location)
public void SetLocation(
    AnalysisRegion location
)
public:
void SetLocation(
    AnalysisRegion^ location
)
public void SetLocation(
    AnalysisRegion location
)
public function SetLocation(
    location : AnalysisRegion
)
参数
- location
 类型:System.Windows.Ink.AnalysisRegion
示例
下面的示例为名为 theTextBox 的 TextBox 控件将一个 TextWordNode 对象添加到名为 theInkAnalyzer 的 InkAnalyzer。该示例将 TextWordNode 对象的 Data 属性设置为 TextBox 的 Text 属性。
' 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;
平台
Windows Vista
.NET Framework 和 .NET Compact Framework 并不是对每个平台的所有版本都提供支持。有关支持的版本的列表,请参见.NET Framework 系统要求。
版本信息
.NET Framework
受以下版本支持:3.0