久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

刪除菜單項(xiàng)周?chē)募?xì)邊框

Removing thin border around the menuitems(刪除菜單項(xiàng)周?chē)募?xì)邊框)
本文介紹了刪除菜單項(xiàng)周?chē)募?xì)邊框的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

問(wèn)題描述

我根據(jù)我曾經(jīng)收到的一些代碼創(chuàng)建了一個(gè)自定義菜單.看起來(lái)不錯(cuò),但我對(duì)如何去除整個(gè)菜單項(xiàng)部分周?chē)暮谏?xì)邊框感到瘋狂?!這個(gè)邊界/填充在哪里定義?

I based a custom menu on some code I once received. It looks OK, but I'm going crazy over how to remove the thin black border around the entire section of menuitems?! Where is this border/padding defined?

感謝任何可以幫助我解決此問(wèn)題的 WPF 專(zhuān)家 :)

Thanks to any WPF guru that might help me with this :)

有效的 XHTML http://img843.imageshack.us/img843/8813/testn.png

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <SolidColorBrush x:Key="HighlightedBackgroundBrush" Color="#003466" />
    <SolidColorBrush x:Key="MenuBackgroundBrush" Color="#003466" />
    <SolidColorBrush x:Key="NormalBorderBrush" Color="#FFFFFFFF" />
    <SolidColorBrush x:Key="SolidMenuFontBrush" Color="#FFFFFFFF" />
    <SolidColorBrush x:Key="HighlightedText" Color="#FFFFFFFF" />

    <Style x:Key="{x:Type Menu}" TargetType="{x:Type Menu}">
        <Setter Property="OverridesDefaultStyle" Value="True"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="Height" Value="25"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Menu}">
                    <Border Background="{DynamicResource AppBackground}"
                            BorderBrush="{DynamicResource AppBackground}"
                            BorderThickness="1">
                        <StackPanel ClipToBounds="True" Orientation="Vertical" IsItemsHost="True"/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="{x:Type MenuItem}" TargetType="{x:Type MenuItem}">
        <Setter Property="OverridesDefaultStyle" Value="True"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type MenuItem}">
                    <Border x:Name="Border" BorderThickness="1">
                        <Grid Background="{DynamicResource AppBackground}">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition x:Name="Col0" MinWidth="17" Width="Auto" SharedSizeGroup="MenuItemIconColumnGroup"/>
                                <ColumnDefinition Width="Auto" SharedSizeGroup="MenuTextColumnGroup"/>
                                <ColumnDefinition Width="Auto" SharedSizeGroup="MenuItemIGTColumnGroup"/>
                                <ColumnDefinition x:Name="Col3" />
                            </Grid.ColumnDefinitions>

                            <!-- ContentPresenter to show an Icon if needed -->
                            <ContentPresenter Grid.Column="0" Margin="4,0,6,0" x:Name="Icon" VerticalAlignment="Center" ContentSource="Icon"/>

                            <!-- Glyph is a checkmark if needed for a checkable menu -->
                            <Grid Grid.Column="0" Visibility="Hidden" Margin="4,0,6,0" x:Name="GlyphPanel" VerticalAlignment="Center">
                                <Path x:Name="GlyphPanelpath" VerticalAlignment="Center" Fill="{TemplateBinding Foreground}" Data="M0,2 L0,4.8 L2.5,7.4 L7.1,2.8 L7.1,0 L2.5,4.6 z" FlowDirection="LeftToRight"/>
                            </Grid>

                            <!-- Content for the menu text etc -->
                            <ContentPresenter Grid.Column="1"
                                Margin="{TemplateBinding Padding}"
                                x:Name="HeaderHost"
                                RecognizesAccessKey="True"
                                ContentSource="Header"/>

                            <!-- Content for the menu IGT -->
                            <ContentPresenter Grid.Column="2"
                                Margin="8,1,8,1"
                                x:Name="IGTHost"
                                ContentSource="InputGestureText"
                                VerticalAlignment="Center"/>

                            <!-- Arrow drawn path which points to the next level of the menu -->
                            <Grid Grid.Column="3" Margin="4,0,6,0" x:Name="ArrowPanel" VerticalAlignment="Center">
                                <Path x:Name="ArrowPanelPath" HorizontalAlignment="Right" VerticalAlignment="Center" Fill="{TemplateBinding Foreground}" Data="M0,0 L0,8 L4,4 z"/>
                            </Grid>

                            <!-- The Popup is the body of the menu which expands down or across depending on the level of the item -->
                            <Popup IsOpen="{Binding Path=IsSubmenuOpen, RelativeSource={RelativeSource TemplatedParent}}" Placement="Right" x:Name="SubMenuPopup" Focusable="false" PopupAnimation="{DynamicResource {x:Static SystemParameters.MenuPopupAnimationKey}}">
                                <Border x:Name="SubMenuBorder" BorderBrush="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType={x:Type Menu}}}" BorderThickness="1" Padding="2,2,2,2">
                                    <Grid x:Name="SubMenu" Grid.IsSharedSizeScope="True">
                                        <!-- StackPanel holds children of the menu. This is set by IsItemsHost=True -->
                                        <StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Cycle"/>
                                    </Grid>
                                </Border>
                            </Popup>
                        </Grid>
                    </Border>

                    <!-- These triggers re-configure the four arrangements of MenuItem to show different levels of menu via Role -->
                    <ControlTemplate.Triggers>
                        <!-- Role = TopLevelHeader : this is the root menu item in a menu; the Popup expands down -->
                        <Trigger Property="Role" Value="TopLevelHeader">
                            <Setter Property="Padding" Value="6,1,6,1"/>
                            <Setter Property="Placement" Value="Bottom" TargetName="SubMenuPopup"/>
                            <Setter Property="MinWidth" Value="2" TargetName="Col0"/>
                            <Setter Property="Width" Value="Auto" TargetName="Col3"/>
                            <Setter Property="Visibility" Value="Collapsed" TargetName="Icon"/>
                            <Setter Property="Visibility" Value="Collapsed" TargetName="GlyphPanel"/>
                            <Setter Property="Visibility" Value="Collapsed" TargetName="IGTHost"/>
                            <Setter Property="Visibility" Value="Collapsed" TargetName="ArrowPanel"/>
                        </Trigger>

                        <!-- Role = TopLevelItem :  this is a child menu item from the top level without any child items-->
                        <Trigger Property="Role" Value="TopLevelItem">
                            <Setter Property="Padding" Value="6,1,6,1"/>
                            <Setter Property="Visibility" Value="Collapsed" TargetName="ArrowPanel"/>
                        </Trigger>

                        <!-- Role = SubMenuHeader : this is a child menu item which does not have children -->
                        <Trigger Property="Role" Value="SubmenuHeader">
                            <Setter Property="DockPanel.Dock" Value="Top"/>
                            <Setter Property="Padding" Value="0,2,0,2"/>
                        </Trigger>

                        <!-- Role = SubMenuItem : this is a child menu item which has children-->
                        <Trigger Property="Role" Value="SubmenuItem">
                            <Setter Property="DockPanel.Dock" Value="Top"/>
                            <Setter Property="Padding" Value="0,2,0,2"/>
                            <Setter Property="Visibility" Value="Collapsed" TargetName="ArrowPanel"/>
                        </Trigger>
                        <Trigger Property="IsSuspendingPopupAnimation" Value="true">
                            <Setter Property="PopupAnimation" Value="None" TargetName="SubMenuPopup"/>
                        </Trigger>

                        <!-- If no Icon is present the we collapse the Icon Content -->
                        <Trigger Property="Icon" Value="{x:Null}">
                            <Setter Property="Visibility" Value="Collapsed" TargetName="Icon"/>
                        </Trigger>

                        <!-- The GlyphPanel contains the CheckMark -->
                        <Trigger Property="IsChecked" Value="true">
                            <Setter Property="Visibility" Value="Visible" TargetName="GlyphPanel"/>
                            <Setter Property="Visibility" Value="Collapsed" TargetName="Icon"/>
                        </Trigger>

                        <!-- Using the system colors for the Menu Highlight and IsEnabled-->
                        <Trigger Property="IsHighlighted" Value="true">
                            <Setter Property="Background" Value="{DynamicResource HighlightedBackgroundBrush}" TargetName="Border"/>
                            <Setter Property="Foreground" Value="{DynamicResource HighlightedText}"/>
                            <Setter Property="BorderBrush" Value="{DynamicResource NormalBorderBrush}" TargetName="Border"/>
                        </Trigger>
                        <Trigger Property="IsHighlighted" Value="false">
                            <Setter Property="Background" Value="{DynamicResource AppBackground}" TargetName="Border"/>
                            <Setter Property="Foreground" Value="{DynamicResource SolidMenuFontBrush}"/>
                            <Setter Property="BorderBrush" Value="{DynamicResource AppBackground}" TargetName="Border"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Foreground" Value="LightGray"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>

推薦答案

...
<!-- The Popup is the body of the menu which expands down or across depending on the level of the item --> 
<Popup ...> 
   <Border x:Name="SubMenuBorder" ... Padding="0">...</Border>...</Popup>

這篇關(guān)于刪除菜單項(xiàng)周?chē)募?xì)邊框的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

Right-click on a Listbox in a Silverlight 4 app(右鍵單擊 Silverlight 4 應(yīng)用程序中的列表框)
WPF c# webbrowser scrolls over top menu(WPF c# webbrowser 在頂部菜單上滾動(dòng))
C# Console app - How do I make an interactive menu?(C# 控制臺(tái)應(yīng)用程序 - 如何制作交互式菜單?)
How to add an icon to System.Windows.Forms.MenuItem?(如何向 System.Windows.Forms.MenuItem 添加圖標(biāo)?)
How to avoid duplicate form creation in .NET Windows Forms?(如何避免在 .NET Windows Forms 中創(chuàng)建重復(fù)的表單?)
Building a database driven menu with ASP.NET, JQuery and Suckerfish(使用 ASP.NET、JQuery 和 Suckerfish 構(gòu)建數(shù)據(jù)庫(kù)驅(qū)動(dòng)的菜單)
主站蜘蛛池模板: 色噜噜亚洲男人的天堂 | 成人免费毛片片v | 日韩一区二区av | 日本三级精品 | 日韩色视频 | 91视视频在线观看入口直接观看 | 国产一区二区精华 | 国产亚洲精品精品国产亚洲综合 | 视频一区二区在线观看 | 三级成人在线观看 | 国产精品中文在线 | 国产成人精品久久二区二区 | 中文一区二区视频 | 青青草久久 | 在线激情视频 | 国产男女视频网站 | 精品国产一区一区二区三亚瑟 | 91视频免费黄 | 欧美天堂 | 影音先锋中文字幕在线观看 | 亚洲精品一区二区三区蜜桃久 | 黄色福利| h视频在线播放 | 亚洲视频二区 | 雨宫琴音一区二区在线 | 成人毛片视频免费 | 久久久做 | 午夜在线电影网 | 中文字幕日韩一区 | 一级毛毛片 | 亚洲一区二区中文字幕在线观看 | 成人免费观看男女羞羞视频 | 国产精品一区在线 | 夜夜骑综合 | 欧美一二三四成人免费视频 | 午夜激情免费视频 | 东京久久 | 欧美 日韩 在线播放 | 在线免费毛片 | 夜夜草视频| 国产精品久久一区二区三区 |