我有一个扩展器,其中一个TextBlock分配给了标头。它旋转了90度。问题是文本看起来不清楚:
正如您所看到的,“调试”并不那么尖锐! 有办法解决吗?
我的XAML代码是
<Window x:Class="Minecraft_Autocarafter.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
<Grid Margin="10,10,10,10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="220*"/>
<ColumnDefinition Width="277*"/>
</Grid.ColumnDefinitions>
<Button Name="RunButton" Content="Run Bot" Click="RunButton_Click" HorizontalAlignment="Left" Width="80" Height="23" VerticalAlignment="Top"/>
<Button x:Name="StopButton" Content="Stop Bot" Click="StopButton_Click" HorizontalAlignment="Left" Width="80" Height="23" VerticalAlignment="Top" Margin="0,28,0,0" IsEnabled="False"/>
<ListBox x:Name="AblaufBox" Margin="100,0,0,0" HorizontalAlignment="Left" Width="100">
<ListBoxItem Content="Started"/>
<ListBoxItem Content="Checking Items"/>
<!--<ListBoxItem Name="Start" Content="Started"/>
<ListBoxItem Name="Start" Content="Started"/>-->
</ListBox>
<Expander Grid.Column="1" Margin="10,0,17,0" ExpandDirection="Right">
<Expander.Header>
<TextBlock Text="Debug">
<TextBlock.RenderTransform>
<TransformGroup>
<RotateTransform Angle="90"/>
<TranslateTransform X="25"/>
</TransformGroup>
</TextBlock.RenderTransform>
</TextBlock>
</Expander.Header>
<Grid Grid.Column="1" Visibility="Visible">
<ListBox Name="DebugListBox">
<ListBoxItem Content="Test"/>
</ListBox>
</Grid>
</Expander>
</Grid>
哦,我在一小时前就开始了WPF,所以请不要点燃我:D
答案 0 :(得分:3)
试试这个
<Expander Grid.Column="1" Margin="10,0,17,0" ExpandDirection="Right">
<Expander.Header>
<TextBlock Text="Debug" TextOptions.TextFormattingMode="Display">
</TextBlock>
</Expander.Header>
</Expander>
请参阅此link
答案 1 :(得分:1)
尝试设置TextBlock
的属性:
UseLayoutRounding="True" OR SnapsToDevicePixels="True"
TextOptions.TextFormattingMode="Display"
TextOptions.TextRenderingMode="ClearType"