TextSelection.ActivePoint 속성
선택 영역의 현재 끝점을 가져옵니다.
네임스페이스: EnvDTE
어셈블리: EnvDTE(EnvDTE.dll)
구문
‘선언
ReadOnly Property ActivePoint As VirtualPoint
VirtualPoint ActivePoint { get; }
property VirtualPoint^ ActivePoint {
VirtualPoint^ get ();
}
abstract ActivePoint : VirtualPoint with 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
.NET Framework 보안
- 직접 실행 호출자의 경우 완전히 신뢰합니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분 신뢰 코드에서 라이브러리 사용를 참조하세요.