Export (0) Print
Expand All

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)

[GuidAttribute(L"42320454-626C-4DD0-9ECB-357C4F1966D8")] 
public interface class VirtualPoint : TextPoint
/** @attribute GuidAttribute("42320454-626C-4DD0-9ECB-357C4F1966D8") */ 
public interface VirtualPoint extends TextPoint
GuidAttribute("42320454-626C-4DD0-9ECB-357C4F1966D8") 
public interface VirtualPoint extends TextPoint

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.

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

Community Additions

ADD
Show:
© 2014 Microsoft