TextRange.Start 속성
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
현재 선택 영역의 시작 부분을 표시하는 위치를 가져옵니다.
public:
property System::Windows::Documents::TextPointer ^ Start { System::Windows::Documents::TextPointer ^ get(); };
public System.Windows.Documents.TextPointer Start { get; }
member this.Start : System.Windows.Documents.TextPointer
Public ReadOnly Property Start As TextPointer
속성 값
현재 선택 영역의 시작 부분을 가리키는 TextPointer입니다.
예제
다음 예제에서는 사용 된 Start 속성입니다.
// This method returns true if two specified selections overlap, including when the
// end of one selection serves as the beginning of the other.
bool DoSelectionsOverlap(TextRange selection1, TextRange selection2)
{
// Is either end of selection2 contained by selection1?
if (selection1.Contains(selection2.Start) || selection1.Contains(selection2.End))
{
// If so, the selections overlap.
return true;
}
// If not, selection2 may still entirely contain selection1.
// Is either end of selection1 contained by seleciotn2?
else if (selection2.Contains(selection1.Start) || selection2.Contains(selection1.End))
{
// If so, the selections overlap.
return true;
}
// If neither selection contains the begging or end of the other selection,
//the selections do not overlap.
else
{
return false;
}
}
' This method returns true if two specified selections overlap, including when the
' end of one selection serves as the beginning of the other.
Private Function DoSelectionsOverlap(ByVal selection1 As TextRange, ByVal selection2 As TextRange) As Boolean
' Is either end of selection2 contained by selection1?
If selection1.Contains(selection2.Start) OrElse selection1.Contains(selection2.End) Then
' If so, the selections overlap.
Return True
' If not, selection2 may still entirely contain selection1.
' Is either end of selection1 contained by seleciotn2?
ElseIf selection2.Contains(selection1.Start) OrElse selection2.Contains(selection1.End) Then
' If so, the selections overlap.
Return True
' If neither selection contains the begging or end of the other selection,
'the selections do not overlap.
Else
Return False
End If
End Function