样式如下:

<Style x:Key="BorderStyle" TargetType="Border">
            <Setter Property="BorderBrush" Value="#55020403" />
            <Setter Property="BorderThickness" Value="2" />
            <Setter Property="CornerRadius" Value="5" />
            <Setter Property="Effect">
                <Setter.Value>
                    <DropShadowEffect
                        BlurRadius="2"
                        Opacity="0.3"
                        ShadowDepth="2"
                        Color="White" />
                </Setter.Value>
            </Setter>
        </Style>

 xmal代码如下:

<Border
            Grid.Column="1"
            Width="200"
            Height="100"
            Style="{StaticResource BorderStyle}">
            <TextBlock
                HorizontalAlignment="Center"
                VerticalAlignment="Center"
                FontSize="36"
                Foreground="#FF45C4EF"
                Text="10:00:00" />
        </Border>

  看起来的效果:

WPF创建一个凹凸效果的边框

 

 

 

 

相关文章:

  • 2021-11-21
  • 2021-07-28
  • 2021-11-01
  • 2022-03-03
  • 2022-12-23
  • 2022-12-23
  • 2021-09-15
  • 2021-12-01
猜你喜欢
  • 2021-07-20
  • 2022-01-14
  • 2021-12-17
  • 2021-12-15
  • 2022-12-23
  • 2021-12-03
  • 2022-12-23
相关资源
相似解决方案