共用方式為


VirtualPoint.VirtualCharOffset 屬性

取得虛擬空間中之虛擬點的資料行索引。

命名空間:  EnvDTE
組件:  EnvDTE (在 EnvDTE.dll 中)

語法

'宣告
ReadOnly Property VirtualCharOffset As Integer
int VirtualCharOffset { get; }
property int VirtualCharOffset {
    int get ();
}
abstract VirtualCharOffset : int
function get VirtualCharOffset () : int

屬性值

型別:System.Int32
整數值;指示虛擬空間中之虛擬點的資料行索引。

備註

字元編號從 1 開始。 VirtualCharOffset 會傳回從文件中一行左側開始到虛擬點所在位置的字元數。

範例

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

.NET Framework 安全性

請參閱

參考

VirtualPoint 介面

EnvDTE 命名空間