Vcl.Menus.TMenuItem.ImageIndex
Delphi
property ImageIndex: TImageIndex read FImageIndex write SetImageIndex stored IsImageIndexStored default -1;
C++
__property System::Uitypes::TImageIndex ImageIndex = {read=FImageIndex, write=SetImageIndex, stored=IsImageIndexStored, default=-1};
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
property | published | Vcl.Menus.pas Vcl.Menus.hpp |
Vcl.Menus | TMenuItem |
Description
Indicates which image maintained by the parent menu appears next to the menu item.
Set ImageIndex to designate an image that should appear next to the caption when the menu item is drawn. On top-level menu items, ImageIndex specifies a zero-offset index into the Images property of the parent menu (TMenu or TPopupMenu). On submenu items, ImageIndex is the zero-offset index into the parent item's SubMenuImages property.
If the parent menu or item does not maintain a list of images, use the Bitmap property to provide an image for a single menu item. However, any image specified by ImageIndex takes precedence over the Bitmap property. Bitmap is only used when ImageIndex has a negative value or the parent's Images or SubMenuImages property is nil (Delphi) or NULL (C++).
Note: This property is not stored with the menu item if it is supplied by a TAction object.