VirtualPoint
This documentation is archived and is not being maintained.

VirtualPoint Object

Visual Studio .NET 2003

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

DTE

   Documents

      Document

         TextDocument

            VirtualPoint

[Visual Basic .NET]
Public Interface VirtualPoint
    Inherits IDispatch
[Visual Basic 6]
Class VirtualPoint
[C++]
interface VirtualPoint : IDispatch
[C#]
public interface VirtualPoint : IDispatch
[JScript .NET]
public interface VirtualPoint extends IDispatch

Remarks

VirtualPoint objects are similar to the TextPoint Object except that it has an added ability to query virtual space locations in a document. They 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.

Requirements

Namespace: EnvDTE

File: dte.olb

Example

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

Properties, Methods and Events | EditPoint Object | TextPoint Object | TextSelection Object

Show:
© 2016 Microsoft