目前我遇到了wpf文本塊的問題。似乎無法使文本進入多行。如果它不適合在屏幕上,它只會從屏幕上消失。我看到一對夫婦建議我將它放在一個ViewBox中,但這隻會使字體縮小,文字變得如此之小以至於無法閱讀。WPF Texblock不能進入MultipleLines
<StackPanel Orientation="Vertical" Grid.Column="1" Margin="0,40,0,0">
<Label Content="Name" Padding="0" FontSize="20"
BorderBrush="{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}"
BorderThickness="0,0,0,2" />
<TextBlock x:Name="TitleBlock" Text="{Binding Title}" FontSize="15" Margin="0,0,0,15" />
<Label Content="Author" Padding="0" FontSize="20"
BorderBrush="{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}"
BorderThickness="0,0,0,2" />
<TextBlock x:Name="AuthorBlock" Text="Just Some Name " FontSize="15" Margin="0,0,0,15" />
<Label Content="Date Published" Padding="0" FontSize="20"
BorderBrush="{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}"
BorderThickness="0,0,0,2" />
<TextBlock x:Name="DateBlock" Text="{Binding ReleaseDate}" FontSize="15" Margin="0,0,0,15" />
<Label Content="Summary" Padding="0" FontSize="20"
BorderBrush="{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}"
BorderThickness="0,0,0,2" />
<TextBlock x:Name="SummaryBox" Text="{Binding Summary}" FontSize="15" Margin="0,0,0,15" />
</StackPanel>
我嘗試使用電網的,而不是StackPanel的,但它仍然犯規解決問題。
總之,我的問題是我如何讓文本塊中的文本可以在多行顯示,如果它不適合屏幕?
將TextBlock