VirtualPoint.VirtualCharOffset VirtualPoint.VirtualCharOffset VirtualPoint.VirtualCharOffset VirtualPoint.VirtualCharOffset Property


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

 property int VirtualCharOffset { int get(); };
[get: System.Runtime.InteropServices.DispId(101)]
public int VirtualCharOffset { get; }
member this.VirtualCharOffset : int
Public ReadOnly Property VirtualCharOffset As Integer
Property Value

An integer value indicating the column index of a virtual point in virtual space.


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.  
   ' 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.  

   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  


Character numbering begins at one. VirtualCharOffset returns the number of characters the virtual point is from the left side of a line in the document.

Applies to