RichTextBox.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 that points to the insertion point closest to the specified position.
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 object specifying the position to retrieve a TextPointer for.
- snapToText
- Boolean
If true
, this method always returns a TextPointer specifying the closest insertion position for the Point specified, regardless or whether or not the supplied Point is inside a character's bounding box.
If false
, this method returns null
if the specified Point does not fall within any character bounding box.
Returns
A TextPointer specifying the closest insertion position for the supplied point, or null
if snapToText
is false
and the supplied Point is not within any character's bounding box. Note that the TextPointer returned is usually the position between two characters. Use the LogicalDirection property of the returned TextPointer to determine which of the two characters the TextPointer corresponds to.
Exceptions
Raised if layout information for the RichTextBox is not current.
Remarks
RichTextBox uses a standard coordinate system with the origin located at the upper-left corner of the RichTextBox.
Applies to
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기