【问题标题】:WPF custom border/panelWPF 自定义边框/面板
【发布时间】:2012-12-22 13:31:34
【问题描述】:

我是 WPF 开发的新手,我无法找到关于如何实现看起来像这样的自定义边框/面板(或下拉菜单)的决定性答案:

这个想法是制作一个下拉菜单/面板(带有中心箭头

【问题讨论】:

    标签: wpf drop-down-menu menu


    【解决方案1】:

    这应该为您指明正确的方向:

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="24"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
    
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="24" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <Polygon
             Fill="LightGray"
            Grid.Column="1">
            <Polygon.Points>
                <Point X="12" Y="0" />
                <Point X="0" Y="24" />
                <Point X="24" Y="24" />
            </Polygon.Points>
        </Polygon>
        <ListBox Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="3" />
    </Grid>
    

    当然,您可以根据需要对其进行自定义... 请注意,在此示例中,我将顶部中间单元格的高度和宽度设置为使箭头为 24X24

    【讨论】:

    • 谢谢你,现在我只需要弄清楚弹出组合。
    猜你喜欢
    • 2011-08-09
    • 1970-01-01
    • 2014-02-21
    • 1970-01-01
    • 2011-11-01
    • 1970-01-01
    • 2014-06-21
    • 2013-11-16
    • 2023-03-12
    相关资源
    最近更新 更多