Example of delphi message sending control scroll bar

Source: Internet
Author: User

This article describes in detail how to implement the message sending control scroll bar in delphi. The main functions and usage are as follows. If you are interested, refer

1. Perform functions

Copy codeThe Code is as follows:
DBGrid1.Perform (WM_VSCROLL, SB_PAGEDOWN, 0); // control the scroll bar and flip back
DBGrid1.Perform (WM_VSCROLL, SB_PAGEUP, 0); // control the scroll bar and flip the page forward


2. SendMessage Function

Copy codeThe Code is as follows:
SendMessage (DBGrid1.Handle, WM_VSCROLL, SB_PAGEDOWN, 0 );
SendMessage (DBGrid1.Handle, WM_VSCROLL, SB_PAGEUP, 0 );


3. PostMessage Function

Copy codeThe Code is as follows:
PostMessage (DBGrid1.Handle, WM_VSCROLL, SB_PAGEDOWN, 0 );
PostMessage (DBGrid1.Handle, WM_VSCROLL, SB_PAGEUP, 0 );


Note: (2, 3 function differences)
PostMessage only puts the message into the queue. No matter whether other programs process the message or not, the message is returned and then continues to be executed;
However, SendMessage must not be returned until other programs process the message.
The returned value of PostMessage indicates whether the PostMessage function is correctly executed;
The return value of SendMessage indicates the return value after other programs process the message.
The most important thing to use these two message sending functions is to check whether your program needs to pay attention to the Message lag. PostMessage will cause the message lag, while SendMessage will not, however, if the SendMessage Message Processing fails, the program will be stopped!

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.