in FlowDocument,how to relocate the cursor while editing ?

after some special editing, I want the cursor to go to a specific location,such as the end or the 5th space in the second line. how can I relocate it ?

Thanks in advance.

[183 byte] By [fanchuan] at [2008-1-4]
# 1
if you are using the richtextbox you could use rtb.CaretPosition
LesterLobo-MSFT at 2007-10-3 > top of Msdn Tech,Visual Studio Orcas,Windows Presentation Foundation (WPF)...
# 2

As Lester said setting RichTextBox.CaretPosition will set the caret location.

You can use the TextPointer methods http://msdn2.microsoft.com/en-us/library/system.windows.documents.textpointer_members.aspx to navigate to the position you want.

SiriVellanki-MSFT at 2007-10-3 > top of Msdn Tech,Visual Studio Orcas,Windows Presentation Foundation (WPF)...
# 3
Thank you , Problem resolved.
fanchuan at 2007-10-3 > top of Msdn Tech,Visual Studio Orcas,Windows Presentation Foundation (WPF)...

Visual Studio Orcas

Site Classified