1

I have a WPF application (VB). I initialize a TextBlock item, when I click in a button, the TexBlock content changes from an empty string ("") to a "foo" string.

I would like to get the value (you know, select it and then copy/paste) but I cant.

What kind of property I have to change in the TextBlock item in order to have this feature on ?

Thanks in advance the community !

  • I know this is the newer question, but I would recommend using the answer here instead of spending a ton of time looking at all the permutations of essentially the same approach in the older Q&A. To this day WPF does not support selectable text for the `TextBlock` object. – kayleeFrye_onDeck May 17 '19 at 03:57

1 Answers1

3

TextBlock does not support text selection. Use a TextBox. If you want it to appear like a TextBlock then set

BorderThickness="0"
IsReadOnly="True"
Glen Thomas
  • 10,190
  • 5
  • 33
  • 65