Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 3.5
MenuItem Class
 SeparatorStyleKey Property

  Switch on low bandwidth view
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
.NET Framework Class Library
MenuItem..::.SeparatorStyleKey Property

Gets the resource key for a style applied to a MenuItem when the MenuItem is a Separator.

Namespace:  System.Windows.Controls
Assembly:  PresentationFramework (in PresentationFramework.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/xaml/presentation
Visual Basic (Declaration)
Public Shared ReadOnly Property SeparatorStyleKey As ResourceKey
Visual Basic (Usage)
Dim value As ResourceKey

value = MenuItem.SeparatorStyleKey
C#
public static ResourceKey SeparatorStyleKey { get; }
Visual C++
public:
static property ResourceKey^ SeparatorStyleKey {
    ResourceKey^ get ();
}
JScript
public static function get SeparatorStyleKey () : ResourceKey
XAML Attribute Usage
<object property={x:Static MenuItem.SeparatorStyleKey}"/>

Property Value

Type: System.Windows..::.ResourceKey
The resource key for a style applied to a MenuItem when the MenuItem is a Separator.

Use this property to change the style of a Separator in a menu.

The following example shows how to use this property to style a Separator in a Menu.

<Style x:Key="{x:Static MenuItem.SeparatorStyleKey}" TargetType="Separator">
  <Setter Property="OverridesDefaultStyle" Value="true" />
  <Setter Property="Template">
    <Setter.Value>
      <ControlTemplate TargetType="{x:Type Separator}">
        <Border Width="30" Height="4" Margin="4" Background="Red"/>
      </ControlTemplate>
    </Setter.Value>
  </Setter>
</Style>

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker