TextSelection.AnchorPoint 속성
선택 영역의 원점을 가져옵니다.
네임스페이스: EnvDTE
어셈블리: EnvDTE(EnvDTE.dll)
구문
‘선언
ReadOnly Property AnchorPoint As VirtualPoint
VirtualPoint AnchorPoint { get; }
property VirtualPoint^ AnchorPoint {
VirtualPoint^ get ();
}
abstract AnchorPoint : VirtualPoint with get
function get AnchorPoint () : VirtualPoint
속성 값
형식: EnvDTE.VirtualPoint
VirtualPoint 개체
설명
하지만 TextPoint 개체에서 선택한 텍스트의 위치를 나타내기는 편집기 창 버퍼에 위치를 표시 하지 않습니다. 또한 줄의 끝을 넘는 가상 공간은 편집기 창에서만 추적됩니다. 따라서 사용 하는 경우는 EditPoint 텍스트를 수정 하려면 텍스트 버퍼에서 텍스트를 선택 하는 정의 되지 않습니다. 예를 들어 명령 수 텍스트 선택, 편집 지점을 가져온 시작한 다음 버퍼를 변경 합니다. 선택한 텍스트를 특정 위치에 되도록 명시적으로 배치 해야 텍스트 선택 해당 위치에 명령 끝에.
예제
Sub AnchorPointExample()
' Before running this example, open a text document.
Dim objSel As TextSelection = DTE.ActiveDocument.Selection
Dim objAnchor As VirtualPoint = objSel.AnchorPoint
' objAnchor is "live", tied to the position of the actual selection,
' so it will reflect any changes. iCol and iRow are created here to
' save a "snapshot" of the anchor point's position at this time.
Dim iCol As Long = objAnchor.DisplayColumn
Dim iRow As Long = objAnchor.Line
' As the selection is extended, the active point moves but the anchor
' point remains in place.
objSel.StartOfDocument(True)
objSel.EndOfDocument(True)
If (iCol = objAnchor.DisplayColumn And iRow = objAnchor.Line) Then
MsgBox("The anchor point has remained in place at row " & iRow & ", display column " & iCol)
End If
End Sub
.NET Framework 보안
- 직접 실행 호출자의 경우 완전히 신뢰합니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분 신뢰 코드에서 라이브러리 사용를 참조하세요.