Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 3.5
MenuItem Class
 SeparatorStyleKey Property
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

Updated: November 2007

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 ();
}
J#
/** @property */
public static ResourceKey get_SeparatorStyleKey()
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.

C#
<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 Vista

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
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker