VirtualPoint.VirtualDisplayColumn 属性

定义

获取当前位置的显示列。

public:
 property int VirtualDisplayColumn { int get(); };
public:
 property int VirtualDisplayColumn { int get(); };
[System.Runtime.InteropServices.DispId(102)]
public int VirtualDisplayColumn { [System.Runtime.InteropServices.DispId(102)] get; }
[<System.Runtime.InteropServices.DispId(102)>]
[<get: System.Runtime.InteropServices.DispId(102)>]
member this.VirtualDisplayColumn : int
Public ReadOnly Property VirtualDisplayColumn As Integer

属性值

Int32

一个整数值,指示当前位置的显示列。

属性

示例

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  

适用于