Delphi Send Message control scroll bar Use example _delphi

Source: Internet
Author: User
1. Perform function
Copy Code code as follows:

Dbgrid1.perform (wm_vscroll,sb_pagedown,0); Control scroll bar, page back
Dbgrid1.perform (wm_vscroll,sb_pageup,0); Control scroll bar, page forward

2. SendMessage function
Copy Code code as follows:

SendMessage (dbgrid1.handle,wm_vscroll,sb_pagedown,0);
SendMessage (dbgrid1.handle,wm_vscroll,sb_pageup,0);

3. PostMessage function
Copy Code code as follows:

PostMessage (dbgrid1.handle,wm_vscroll,sb_pagedown,0);
PostMessage (dbgrid1.handle,wm_vscroll,sb_pageup,0);

Note: (2, 3 function difference)
PostMessage simply puts the message in the queue, returns if the other program is processed, and continues execution;
SendMessage must wait for the other program to process the message before returning to continue execution.
The return value of the PostMessage indicates whether the PostMessage function is executing correctly;
The return value of the SendMessage represents the return value of the other program after the message is processed.
The most important thing to use to send a message function is to see if your program should be concerned about the hysteresis of the message, PostMessage will cause the delay of the message, while SendMessage will not, but if SendMessage message processing fails, it will cause the program to stop!

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.