MenuItem.Icon Property


Gets or sets the icon that appears in a MenuItem.

 property System::Object ^ Icon { System::Object ^ get(); void set(System::Object ^ value); };
public object Icon { get; set; }
member this.Icon : obj with get, set
Public Property Icon As Object

Property Value

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



The following example creates a menu item with an icon.

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


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

Dependency Property Information

Identifier field IconProperty
Metadata properties set to true None

Applies to