tags:

views:

16

answers:

2

I only found a way to:

<TextBox Text="Text!" 
IsReadOnly="True" 
IsTabStop="False" 
BorderThickness="0"
>
    <TextBox.Style>
        <Style TargetType="{x:Type TextBox}">
            <Style.Triggers>
                <MultiTrigger>
                    <MultiTrigger.Conditions>
                        <Condition Property="IsMouseOver" Value="False" />
                        <Condition Property="IsFocused" Value="False" />
                    </MultiTrigger.Conditions>
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="{x:Type TextBox}">
                                <TextBlock Text="{TemplateBinding Text}" />
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </MultiTrigger>
            </Style.Triggers>
        </Style>
    </TextBox.Style>
</TextBox>

There is another option not so big?

+1  A: 

Why not use a TextBox if you want it to be interactive ?
TextBlocks should be used to display static text -- its a light weight variant of the WPF Label.

Gishu
I need that would be interactive, just that you could select and copy.Label, too, does not release the text
simply denis
@simply, if you need to be able to right click and copy text, I think you should use a textbox. If you do not want the user to change the text, set its readonly prop to true.
Gishu
+2  A: 

Gishu has the right idea.

Use a TextBox and make it ReadOnly. The user can select and copy the text, but cannot alter the text.

    <TextBox IsReadOnly='True'  Text='ABC ABD ABC ABD'/>
Walt Ritscher
yes. full of happiness, we must add BorderThickenes = 0
simply denis