开发者

WPF Select text + Highlight

开发者 https://www.devze.com 2023-04-13 08:49 出处:网络
I have a ListView with a Binding Property with {get;set;} Name ( type string ) and each one isbinding in WPF textblock.

I have a ListView with a Binding Property with {get;set;} Name ( type string ) and each one is binding in WPF textblock.

First requirement be able to select a path of the text using cursor and to copy with Ctrl+C (This can be done with textBox).

Second requirement is to highlight programmatically any part of Name which contains a string, and this should be able to highlight all name开发者_开发知识库s in that list (this can be done with textblock with inlines).

Question: how i can combine these two ?


Sounds like you want RichTextBox. It contains inlines, like TextBlock does, but it also supports highlighting and copying.

0

精彩评论

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

关注公众号