TextBlock.GetPositionFromPoint(Point, Boolean) Method
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
- 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.
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.
Current, valid layout information for the control is unavailable.
This method always returns a valid TextPointer when snapToText
is true
.
Product | Versions |
---|---|
.NET Framework | 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9, 10 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: