【问题标题】:WPF Popup with rounded corners at the bottom only仅底部带有圆角的 WPF 弹出窗口
【发布时间】:2017-12-28 13:46:03
【问题描述】:

我想知道是否可以仅将圆角应用于 WPF 弹出窗口底角。

我知道可以将圆角应用于所有 WPF 弹出角,例如,this,但我不确定。那么有可能吗?如果有,你能举个小例子吗?

【问题讨论】:

  • CornerRadius="0,0,10,10" 试试这个

标签: c# wpf visual-studio-2008 popup .net-3.5


【解决方案1】:

我正在根据需要提供模板自定义

<Style x:Key="PopupContentStyle" TargetType="{x:Type ContentControl}">
            <Setter Property="ContentTemplate">
                <Setter.Value>
                    <DataTemplate>
                        <Border BorderBrush="Gray" BorderThickness="2" 
                         CornerRadius="0,0,20,20" Width="60" Height="60">

                        </Border>
                    </DataTemplate>
                </Setter.Value>
            </Setter>
        </Style>

然后

   <Popup>
        <ContentControl Style="{StaticResource PopupContentStyle}">

        </ContentControl>
    </Popup>

【讨论】:

    猜你喜欢
    • 2013-08-09
    • 1970-01-01
    • 1970-01-01
    • 2010-12-15
    • 1970-01-01
    • 2012-07-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多