开发者

WPF RichTextBox - Parent element from caret position

开发者 https://www.devze.com 2023-01-03 22:48 出处:网络
Consider this document structure: <FlowDocument><Paragraph>loreM Ipsum</Paragraph></FlowDocument>

Consider this document structure:

<FlowDocument><Paragraph>loreM Ipsum</Paragraph></FlowDocument>

And my caret position is between 'M' and 'I' in the RichTextBox. How can I get the parent element from caret position? In this cas开发者_如何学JAVAe the parent would be the Paragraph.


RichTextBox.CaretPosition.Parent

I think the parent element in that case will actually be a Run, and the parent of the Run will be the Paragraph.

0

精彩评论

暂无评论...
验证码 换一张
取 消