다음을 통해 공유


TextSelection.ActivePoint 속성

업데이트: 2007년 11월

선택 영역의 현재 끝점을 가져옵니다.

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

구문

ReadOnly Property ActivePoint As VirtualPoint

Dim instance As TextSelection
Dim value As VirtualPoint

value = instance.ActivePoint
VirtualPoint ActivePoint { get; }
property VirtualPoint^ ActivePoint {
    VirtualPoint^ get ();
}
function get ActivePoint () : VirtualPoint

속성 값

형식: EnvDTE.VirtualPoint

VirtualPoint 개체입니다.

설명

TextPoint 개체는 편집기 창에서 선택한 텍스트의 위치를 나타내지만 버퍼 내의 위치는 표시하지 않습니다. 또한 줄의 끝을 넘는 가상 공간은 편집기 창에서만 추적됩니다. 따라서 텍스트 버퍼에서 EditPoint 개체를 사용하여 텍스트를 수정하는 경우 선택한 텍스트가 어떻게 처리되는지는 정의되지 않습니다. 선택한 텍스트로 시작하여 편집 지점을 가져온 다음 버퍼를 변경하는 명령을 예로 들 수 있습니다. 선택한 텍스트가 특정 위치에 있도록 하려면 명령의 끝에서 이 텍스트를 명시적으로 특정 위치에 지정해야 합니다.

예제

Sub ActivePointExample()
   ' 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.")
End Sub

권한

  • 직접 실행 호출자의 경우 완전히 신뢰합니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분 신뢰 코드에서 라이브러리 사용을 참조하십시오.

참고 항목

참조

TextSelection 인터페이스

TextSelection 멤버

EnvDTE 네임스페이스