다음을 통해 공유


VirtualPoint.VirtualCharOffset 속성

가상 공간에 있는 가상 지점의 열 인덱스를 가져옵니다.

네임스페이스:  EnvDTE
어셈블리:  EnvDTE(EnvDTE.dll)

구문

‘선언
ReadOnly Property VirtualCharOffset As Integer
    Get
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 네임스페이스