[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | Reference for unit 'Menus' (#lcl)

# TMenuItem.HasIcon

True when a bitmap is configured and available for the menu item.

## Declaration

Source position: menus.pp line 271

`public function TMenuItem.HasIcon: Boolean; virtual;`

## Function result

True when a bitmap is configured and available for the menu item.

## Description

HasIcon is a Boolean function which indicates if a Bitmap is configured and available for the menu item. The menu item is configured to display a bitmap using the GlyphShowMode and ImageIndex properties, or by assigning a TBitmap value to the Bitmap property.

The return value is False for the following conditions:

- GlyphShowMode is set to gsmNever.
- GlyphShowMode is set to gsmApplication and TApplication.ShowMenuGlyphs is set to sbgNever.
- GlyphShowMode is set to gsmSystem and SystemShowGlyphMenus returns False.
- An image list is not available or ImageIndex contains an invalid index.
- Bitmap has an empty image.

## See also

TMenuItem.Bitmap |  | Bitmap image (glyph) displayed for the menu item.
TMenuItem.GlyphShowMode |  | Indicates the display behavior for the glyph (or Bitmap) on the menu item.
TMenuItem.GetImageList |  | Gets an image list with the available bitmaps for the menu item.
TMenuItem.ImageIndex |  | Ordinal position in the list of images for the glyph displayed on the menu item.
TMenuItem.GetIconSize |  | Gets the size for the icon (glyph) when used on the menu item.
TMenuItem.UpdateWSIcon |  | Updates the widgetset class with the values in HasIcon and Bitmap.
TApplication.ShowMenuGlyphs |  | Sets the default policy for showing or hiding glyph images in menus.