There are two sets of circumstances that require you to declare new message-handling methods:
- Your component needs to handle a Windows message that is not already handled by the standard components.
- You have defined your own message for use by your components.
To declare a message-handling method, do the following:
- Declare the method in a protected part of the component's class declaration.
- Make the method a procedure.
- Name the method after the message it handles, but without any underline characters.
- Pass a single var parameter called Message, of the type of the message record.
- Within the message method implementation, write code for any handling specific to the component.
- Call the inherited message handler.