Author: Tomas Rutkauskas
I want to put two buttons as a scrollbar to my grid instead of using the default
Delphi windows scrollbar. I suppose that I should handle the messages like
WM_VSCROLL and WM_HSCROLL and setting my grid.Scrollbars := none
Answer:
You should send these messages to the grid on your button presses, e.g. for a line
up:
1 { ... }2 with stringgrid1 do3 begin4 perform(WM_VSCROLL, SB_LINEUP, 0);
5 perform(WM_VSCROLL, SB_ENDSCROLL, 0);
6 end;
7 8 //or use:9 10 procedure buttonupClick(sender);
11 begin12 SendMessage(Grid1.Handle, WM_VSCROLL, SB_LINEUP, 0)
13 end;