EditPoint.MoveToPoint 方法
將作用點移至指定的位置。
命名空間: EnvDTE
組件: EnvDTE (在 EnvDTE.dll 中)
語法
'宣告
Sub MoveToPoint ( _
Point As TextPoint _
)
void MoveToPoint(
TextPoint Point
)
void MoveToPoint(
[InAttribute] TextPoint^ Point
)
abstract MoveToPoint :
Point:TextPoint -> unit
function MoveToPoint(
Point : TextPoint
)
參數
- Point
型別:EnvDTE.TextPoint
必要項。TextPoint 物件,表示字元移入的位置。
範例
Sub MoveToPointExample()
Dim objTextDoc As TextDocument
Dim objMovePt As EditPoint
Dim objEditPt As EditPoint, iCtr As Integer
' Create a new text file.
DTE.ItemOperations.NewFile("General\Text File")
' Get a handle to the new document and create an EditPoint.
objTextDoc = DTE.ActiveDocument.Object("TextDocument")
objEditPt = objTextDoc.StartPoint.CreateEditPoint
objMovePt = objTextDoc.EndPoint.CreateEditPoint
' Insert ten lines of text.
For iCtr = 1 To 10
objEditPt.Insert("This is a test." & Chr(13))
Next iCtr
' Move the active point to the location of the second edit point
' and then insert some text.
objEditPt.StartOfDocument()
objMovePt.LineDown(3)
objEditPt.MoveToPoint(objMovePt)
objEditPt.Insert("HELLO")
End Sub
.NET Framework 安全性
- 完全信任立即呼叫者。這個成員無法供部分信任的程式碼使用。如需詳細資訊,請參閱從部分受信任程式碼使用程式庫。