【发布时间】:2016-12-23 16:35:05
【问题描述】:
目前我正在处理包含标签的 wpf 弹出窗口,该标签由控件模板内的文本块组成。这里我的问题是弹出窗口有一个底部边框阴影。弹出框已经有了一个边框,并且这种阴影效果增加了底部边框的厚度,看起来像这样(查看下面的链接以查看弹出窗口的屏幕截图)。
wpf代码是这样的
标签控件模板样式
<Style x:Key="popuplabelstyle" TargetType="{x:Type Label}">
<Setter Property="OverridesDefaultStyle" Value="true" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Label}">
<Border BorderBrush="Red" x:Name="labelBorder" BorderThickness="1" Padding="12" Background="White" Height="auto" MinHeight="260" Width="220">
<StackPanel>
<TextBlock Text="ABCD" Margin="0,0,0,4" />
<TextBlock Text="abcd" Margin="0,4,0,0" />
</StackPanel>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
弹出窗口的 xml 代码
<Popup x:Name="Mypopup" Panel.ZIndex="2" Placement="MousePoint" HorizontalOffset="10" VerticalOffset="10" IsOpen="{Binding ">
<Label Style="{StaticResource popuplabelstyle}"/>
</Popup>
我不知道为什么会这样。谁能帮我解决这个问题?
查看弹窗截图in below link
【问题讨论】:
-
我用你提供的代码看不到这个边框阴影。你如何显示弹出窗口?
-
您的问题是什么?弹出窗口有边框吗?
-
你看到截图了吗??