Vcl.Menus.TMenuItem.GetImageList

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function GetImageList: TCustomImageList;

C++

Vcl::Imglist::TCustomImageList* __fastcall GetImageList();

Properties

Type Visibility Source Unit Parent
function public
Vcl.Menus.pas
Vcl.Menus.hpp
Vcl.Menus TMenuItem

Description

Returns the Image list that supplies an image for the menu item.

Use GetImageList to access the list of images that contains the image for this menu item. The ImageIndex property identifies a specific image from the list that GetImageList returns.

GetImageList first checks the Parent of this menu item for a SubMenuImages property. If the parent menu item does not maintain a list of images, it checks that menu item's parent, and so on until reaching a top-level menu item (a menu item where Parent is not set). If none of the parent menu items has a SubMenuImages property, GetImageList checks the top-level menu for an Images property.

GetImageList returns the first image list it finds. If it doesn't find an image list, GetImageList returns nil (Delphi) or NULL (C++).

See Also