tags:

views:

279

answers:

1

In WPF how to create a textblock with copy text option (OR) a text box with text trimming option. Any control template needed? If yes, please let us know hpw to build it. Please help.

Sukan

A: 

First part is a duplicate of http://stackoverflow.com/questions/136435/any-way-to-make-a-wpf-textblock-selectable.

TextTrimming is a property in the TextBox.

Jobi Joy
The other question of the same sort is not answered. A control template is not an attribute of a textblock so how to create one?Also there is no 'TextTrimming' property in TextBox. Am I mistaking something? Please help.
Sukan
Template is the attribute a ControlTemplate would be assigned to, for any WPF control.
opedog
There is no option of designing Template for a textblock. I would like to extend on textblock a copy to clipboard feature because1. TextBlock is the light weight component2. Textblock already has texttrimming and wrapping and noteditable options. Only copy to clipboard is the requirement. Is there any other option? Please help.
Sukan
Temporarily I have used a Grid with textblock and textbox with textbox foreground property set to transparent. It is not the right way to do, but since there are only 2 to 3 places where I would need this control , I have used this. Please suggest if any concerns available. Thanks in advance.
Sukan