Custom message of VCL

Source: Internet
Author: User

Procedure cmwantspecialkey (var msg: tcmwantspecialkey); message cm_wantspecialkey;
{Note:
Cm_wantspecialkey-tcmwantspecialkey-(cm_base + 30)
Sent by tcontrol in response to cn_keydown and cn_keyup

Intercept special keys such as vk_tab, vk_left, vk_right, vk_up, vk_down, vk_return, vk_execute,
Vk_escape and vk_cancel
The cm_wantspecialkey component provides easier and more flexible judgment than intercepting wm_getdlgcode window messages.
Method to Determine whether certain special keys are required. When the control receives any special key, it sends the cm_wantspe
The cialkey component message is sent to the control.

Example:
Procedure tcustomgrid. cmwantspecialkey (var msg: tcmwantspecialkey );
Begin
Inherited;
If (goediting in options) and (char (msg. charcode) = #13) Then MSG. Result: = 1;
End;

Note:
When processing vk_tab, the effect of pressing the tab key is limited to this control. In other words, the focus is not set to the bottom.
A widget.

Related:
WINDOS message wm_getdlgcode
}
Procedure cmdesignhittest (var msg: tcmdesignhittest); message cm_designhittest;
{Note:
Cm_designhittest-tcmdesignhittest-(cm_base + 28)
Special message never sent from within the VCL (but from a designer DLL), used only
Design Time to determine whether a control wants mouse and key input. Message. Result = 1
If the control behaves like at runtime else 0

To process this message, you can add the scroll bar component to the component and enable it to act during the design period.
You must use the following method to create a scroll bar for your component:
Example:
Tmyscrollbar = Class (tscrollbar)
Procedure cmdesignhittest (VAR message: tcmdesignhittest); message cm_designhittest;
End;
Procedure tmyscrollbar. cmdesignhittest (VAR message: tcmdesignhittest );
Begin
Message. Result: = 1;
End;
You must use the following method to create a scroll bar for your component:
Tmyscrollbar. Create (NiL );
Instead
Tmyscrollbar. Create (Self );
}

Procedure cndrawitem (VAR message: twmdrawitem); message cn_drawitem;
Procedure cnmeasureitem (VAR message: twmmeasureitem); message cn_measureitem;
{Note:
Procedure cndrawitem (VAR message: twmdrawitem); message cn_drawitem;
Procedure cnmeasureitem (VAR message: twmmeasureitem); message cn_measureitem;
The two messages are closely related --
Refer to this document in "Delphi-> application tips-> message events in Delphi-> Windows messages"
Procedure wmmeasureitem (VAR message: twmmeasureitem); message wm_measureitem;
Procedure wmdrawitem (VAR message: twmdrawitem); message wm_drawitem;
Description

Example:
Refer to "" Delphi-> application tips-> draw controls in Delphi-> compile the ownerdraw method in Delphi.
Button method and the implementation code of the Custom button provided in note.
}

Custom message of VCL

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.