Compartilhar via


VirtualPoint Interface

Definition

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

public interface class VirtualPoint : EnvDTE::TextPoint
public interface class VirtualPoint : EnvDTE::TextPoint
__interface VirtualPoint : EnvDTE::TextPoint
[System.Runtime.InteropServices.Guid("42320454-626C-4DD0-9ECB-357C4F1966D8")]
[System.Runtime.InteropServices.TypeLibType(4160)]
public interface VirtualPoint : EnvDTE.TextPoint
[<System.Runtime.InteropServices.Guid("42320454-626C-4DD0-9ECB-357C4F1966D8")>]
[<System.Runtime.InteropServices.TypeLibType(4160)>]
type VirtualPoint = interface
    interface TextPoint
Public Interface VirtualPoint
Implements TextPoint
Attributes
Implements

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  

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.

Properties

AbsoluteCharOffset

Gets the one-based character offset from the beginning of the document to the object.

AtEndOfDocument

Returns true if the object is at the end of the document.

AtEndOfLine

Returns true if the object is at the end of a line.

AtStartOfDocument

Returns true if the object is at the beginning of the document.

AtStartOfLine

Returns true if the object is at the beginning of a line.

CodeElement[vsCMElement]

Returns the code element at the VirtualPoint location.

DisplayColumn

Gets the number of the current displayed column containing the object.

DTE

Gets the top-level extensibility object.

Line

Gets the line number of the object.

LineCharOffset

Gets the character offset of the object.

LineLength

Gets the number of characters in a line containing the object, excluding the new line character.

Parent

Gets the immediate parent object of a VirtualPoint object.

VirtualCharOffset

Gets the column index of a virtual point in virtual space.

VirtualDisplayColumn

Gets the display column of the current position.

Methods

CreateEditPoint()

Creates and returns an EditPoint object at the location of the calling object.

EqualTo(TextPoint)

Returns whether the value of the given TextPoint object's AbsoluteCharOffset property is equal to that of the calling VirtualPoint object.

GreaterThan(TextPoint)

Returns whether the value of the calling object's AbsoluteCharOffset property is greater than that of the given point object.

LessThan(TextPoint)

Returns whether the value of the called object's AbsoluteCharOffset property is less than that of the given object.

TryToShow(vsPaneShowHow, Object)

Attempts to display the text point's location.

Applies to