VirtualPoint 介面
更新:2007 年 11 月
可讓您管理超過文字文件右邊界的文字,在雙向 (Bidirectional) Windows 中則為左邊界。
命名空間: EnvDTE
組件: EnvDTE (在 EnvDTE.dll 中)
語法
<GuidAttribute("42320454-626C-4DD0-9ECB-357C4F1966D8")> _
Public Interface VirtualPoint _
Implements TextPoint
Dim instance As VirtualPoint
[GuidAttribute("42320454-626C-4DD0-9ECB-357C4F1966D8")]
public interface VirtualPoint : TextPoint
[GuidAttribute(L"42320454-626C-4DD0-9ECB-357C4F1966D8")]
public interface class VirtualPoint : TextPoint
public interface VirtualPoint extends TextPoint
備註
VirtualPoint 物件與 TextPoint 物件相似,不過,前者可以查詢文件中的虛擬空間。VirtualPoint 物件由 TextSelection.StartPoint 和 TextSelection.EndPoint 傳回。
虛擬空間指現有文字行右邊的空白空間以及存在此區域的虛擬點。
範例
Sub VirtualPointExample()
' Before running this example, open a text document.
Dim objSel As TextSelection = DTE.ActiveDocument.Selection
Dim objActive As VirtualPoint = objSel.ActivePoint
' Collapse the selection to the beginning of the line.
objSel.StartOfLine()
' objActive is "live", tied to the position of the actual selection,
' so it will reflect the new position.
Dim iCol As Long = objActive.DisplayColumn
' Move the selection to the end of the line.
objSel.EndOfLine()
MsgBox("The length of the insertion point line is " & (objActive.DisplayColumn - iCol) & " display characters.")
MsgBox("VirtualCharOffset value: " & objActive.VirtualCharOffset & vbCr & "VirtualDisplayColumn value: " & objActive.VirtualDisplayColumn)
End Sub