10

I'm working on my first WPF application and I notice that I'm not able to edit the text values in any of my textblocks.

I can't seem to find anything wrong here that would prevent me from changing it...

<Label Content="Line Terminator" Grid.Row="0" Grid.Column="0" Margin="5"></Label>
<Border BorderThickness="1" BorderBrush="LightBlue" Grid.Row="0" Grid.Column="1" Margin="5">
    <TextBlock x:Name="txtLineTerm" Focusable="True" IsManipulationEnabled="True" Padding="3"></TextBlock>
</Border>
<Label Content="Field Terminator" Grid.Row="0" Grid.Column="2" Margin="5"></Label>
<Border BorderThickness="1" BorderBrush="LightBlue" Grid.Row="0" Grid.Column="3" Margin="5">
    <TextBlock x:Name="txtFieldTerm" Focusable="True" IsManipulationEnabled="True" Padding="3"></TextBlock>
</Border>

Can anyone see the problem? I feel like there's a concept that I'm missing here. Any explanation will be greatly appreciated.

4

2 に答える 2

22

TextBlock は編集できません。代わりに TextBox を使用してください。

于 2013-01-30T08:21:45.760 に答える
4

リンクに示されているようにEditableTextBlockを使用できます

于 2013-01-30T09:04:01.577 に答える