wpf icon indicating copy to clipboard operation
wpf copied to clipboard

Text selection for TextBlock And AutoSize for RichTextBox

Open Red6789 opened this issue 2 years ago • 3 comments

When you use WPF to develop chat applications, you will find that you need to use the TextBlock control to display rich text and allow the user to select and copy text is a very common need, if you use TextBox to implement it lacks TextBlock's Inlines property, if you use RichTextBox to implement it lacks TextBlock's automatic width and height properties, I hope to add the function of the selection effect to TextBlock. RichTextBox adds automatic height and width

Red6789 avatar Jun 16 '23 05:06 Red6789

Agreed, TextBlock needs an easy way to enable text selection. Current workarounds either lose some TextBlock behavior (as mentioned by @Red6789) or they just mimic text selection instead of the native text selection feature.

It's worth noting that UWP has TextBlock.IsTextSelectionEnabled property and WPF should too!

Patch4747 avatar Sep 05 '25 22:09 Patch4747

@Patch4747 How about the ReadOnly TextBox ?

lindexi avatar Sep 08 '25 02:09 lindexi

@lindexi it said in the issue it needs rich text

miloush avatar Sep 08 '25 07:09 miloush