TextBlocks のサイズを調整しようとすると問題が発生します。3 列と 6 行のグリッドがあり、2 番目の列には各行に TextBlock があり、各 TextBlock テキストの長さが異なるため、ウィンドウのサイズを変更すると、一部のテキストが他のテキストよりも大きくまたは小さく見えます。
ウィンドウのサイズを変更するときに各 TextBlock を同じスケールにする方法はありますか? ウィンドウのサイズを変更すると、すべての TextBlock が同じサイズに見えるようになります。
これは私が持っているコードです:
<Grid Name="grid">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Viewbox Grid.Column="1">
<TextBlock x:Name="txt1" Text="Some long text 12345" FontSize="20" />
</Viewbox>
<Viewbox Grid.Column="1" Grid.Row="1">
<TextBlock x:Name="txt2" Text="Some longer text 1234567890" FontSize="20" />
</Viewbox>
<Viewbox Grid.Column="1" Grid.Row="2">
<TextBlock x:Name="txt3" Text="Text3" FontSize="20" />
</Viewbox>
<Viewbox Grid.Column="1" Grid.Row="3">
<TextBlock x:Name="txt4" Text="Text4" FontSize="20" />
</Viewbox>
<Viewbox Grid.Column="1" Grid.Row="4">
<TextBlock x:Name="txt5" Text="Text5" FontSize="20" />
</Viewbox>
<Viewbox Grid.Column="1" Grid.Row="5">
<TextBlock x:Name="txt6" Text="Text6" FontSize="20" />
</Viewbox>
前もって感謝します、
アルベルト