TextBlock.GetPositionFromPoint(Point, Boolean) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns a TextPointer to the position closest to a specified Point.
public:
System::Windows::Documents::TextPointer ^ GetPositionFromPoint(System::Windows::Point point, bool snapToText);
public System.Windows.Documents.TextPointer GetPositionFromPoint (System.Windows.Point point, bool snapToText);
member this.GetPositionFromPoint : System.Windows.Point * bool -> System.Windows.Documents.TextPointer
Public Function GetPositionFromPoint (point As Point, snapToText As Boolean) As TextPointer
Parameters
- point
- Point
A Point in the coordinate space of the TextBlock for which to return a TextPointer.
- snapToText
- Boolean
true
to return a TextPointer to the insertion point closest to point
, whether or not point
is inside a character's bounding box; false
to return null
if point
is not inside a character's bounding box.
Returns
A TextPointer to the specified point, or null
if snapToText
is false
and the specified point does not fall within a character bounding box in the TextBlock content area.
Exceptions
Current, valid layout information for the control is unavailable.
Remarks
This method always returns a valid TextPointer when snapToText
is true
.
Applies to
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기