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!