我有一个表单,其中包括文本块、标签和边框。我想要能够像在MS Word或HTML表格中选择文本一样使用鼠标选择文本。但我不能使用TextBox或RichTextBox。有没有办法实现我的目标?
<Grid Margin="20">
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<Border BorderBrush="Black" BorderThickness="1">
<StackPanel Orientation="Horizontal">
<TextBlock Text="some text in TextBlock" VerticalAlignment="Center"/>
<Label Content="another text in Label"/>
</StackPanel>
</Border>
<Border Grid.Row="1" BorderBrush="Black" BorderThickness="1">
<StackPanel Orientation="Horizontal">
<TextBlock Text="one more in TextBlock" VerticalAlignment="Center"/>
<Label Content="one more text in Label"/>
</StackPanel>
</Border>
TextBox
,而不是使用TextBlock
实现此目的。 - Salah Akbari