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

# TCustomForm.CMDeactivate

Handles the CM_DEACTIVATE control message for the form.

## Declaration

Source position: forms.pp line 623

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

## Arguments

`Message` |  | Control message processed in the method.

## Description

This message occurs when the form loses focus within the application.

Calls the Deactivate method to signal the OnDeactivate event handler (when assigned). Ensures that the Menu merged to the application MainForm during activation is removed from the Menu for the Application. This action is not performed at design-time, or when Menu has not been assigned. It applies to a form using the fsMDIChild form style in an application using the fsMDIForm style in its MainForm.