TextBlock 有奇怪的白色轮廓
请帮忙弄清楚这个奇怪的 TextBlock
白色轮廓是如何出现的。
XAML
<StackPanel Grid.ColumnSpan="2" Grid.Row="1" Grid.RowSpan="2" >
<local:Marquee x:Name="marquee1" Height="100" Width="800" Margin="0,0,0,0">
<ListBox Name="lstItems" ItemsPanel="{StaticResource ItemsPanelTemplate1}" VerticalAlignment="Center" Background="{x:Null}" >
</ListBox>
</local:Marquee>
</StackPanel>
C#
TextBlock tb = new TextBlock();
tb.IsEnabled = false;
tb.Text = Text;
tb.FontWeight = FontWeights.Normal;
tb.Foreground = color;
tb.FontSize = marquee1.Height / koeff;
tb.TextWrapping = TextWrapping.Wrap;
if (!string.IsNullOrEmpty(fFamily))
tb.FontFamily = new FontFamily(fFamily);
if (bColor != null)
{
if (bColor != Brushes.Transparent)
tb.Background = bColor;
}
lstItems.Items.Add(tb);
Please help to figure out how this strange white outline of TextBlock
appears.
XAML
<StackPanel Grid.ColumnSpan="2" Grid.Row="1" Grid.RowSpan="2" >
<local:Marquee x:Name="marquee1" Height="100" Width="800" Margin="0,0,0,0">
<ListBox Name="lstItems" ItemsPanel="{StaticResource ItemsPanelTemplate1}" VerticalAlignment="Center" Background="{x:Null}" >
</ListBox>
</local:Marquee>
</StackPanel>
C#
TextBlock tb = new TextBlock();
tb.IsEnabled = false;
tb.Text = Text;
tb.FontWeight = FontWeights.Normal;
tb.Foreground = color;
tb.FontSize = marquee1.Height / koeff;
tb.TextWrapping = TextWrapping.Wrap;
if (!string.IsNullOrEmpty(fFamily))
tb.FontFamily = new FontFamily(fFamily);
if (bColor != null)
{
if (bColor != Brushes.Transparent)
tb.Background = bColor;
}
lstItems.Items.Add(tb);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不认为它属于
TextBlock
除非你有一个添加它的样式,它似乎更可能属于包含它的ListBox
。I don't think it belongs to the
TextBlock
unless you have a style somewhere which adds it, it seems more likely that it belongs to theListBox
containing it.