Icon Property

MenuItem.Icon Property


Gets or sets the icon that appears in a MenuItem.

Namespace:   System.Windows.Controls
Assembly:  PresentationFramework (in PresentationFramework.dll)

public object Icon { get; set; }

Property Value

Type: System.Object

The icon that appears in a MenuItem. The default value is null.

Many Menu controls have more than just text in the MenuItem elements. Often there are icons, check marks, accelerators, and arrows to indicate submenus.

Identifier field


Metadata properties set to true


The following example creates a menu item with an icon.

<MenuItem Header="New">
    <Image Source="data/cat.png"/>

.NET Framework
Available since 3.0
Return to top
© 2015 Microsoft