Bagikan melalui


VirtualPoint Interface

Allows you to manipulate text beyond the right margin (left margin in bidirectional Windows) of the text document.

Namespace:  EnvDTE
Assembly:  EnvDTE (in EnvDTE.dll)

Syntax

'Declaration
<GuidAttribute("42320454-626C-4DD0-9ECB-357C4F1966D8")> _
Public Interface VirtualPoint _
    Inherits TextPoint
'Usage
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

Remarks

VirtualPoint objects are similar to the TextPoint object except that they can query virtual space in a document. VirtualPoint objects are returned by TextSelection.StartPoint and TextSelection.EndPoint.

Virtual space is the empty space to the right of existing lines of text, and virtual points exist in this area.

Examples

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

See Also

Reference

VirtualPoint Members

EnvDTE Namespace