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

# TCustomForm.CMIconChanged

Handles the CM_ICONCHANGED control message for the form.

## Declaration

Source position: forms.pp line 620

`protected procedure TCustomForm.CMIconChanged(`
`var Message: TLMessage`
`); message;`

## Arguments

`Message` |  | Control message for the notification.

## Description

CMIconChanged is a method used to perform actions needed when the CM_ICONCHANGED control message is handled for a form. CMIconChanged calls a private method (IconChanged) to free and re-create handle(s) for icons used on the form.

The CM_ICONCHANGED control message occurs when a new value is assigned to the Icon property, and when the BorderStyle property is changed. At run-time, the widgetset class is notified by calling its SetIcon method when BorderStyle contains a value that allows icons. bsDialog and bsNone do not display icons.

## Version info

Modified in LCL version 4.0 to use assigned handles in SmallIconHandle and BigIconHandle when BorderStyle is changed to a value other than bsNone or bsDialog.

## See also

TCustomForm.BorderStyle |  | The border style affects the title bar, border, icon(s), and resize behavior for the form.
TCustomForm.Icon |  | The Icon associated with this Form (in minimized state).
TCustomForm.SmallIconHandle |  | Returns (and optionally creates) the Handle for the small Icon used for the form.
TCustomForm.BigIconHandle |  | Returns the handle for the large icon on the form or in the application.