Author: Tomas Rutkauskas
How to make the scrollbar of a TStringGrid show a proportional thumb
Answer:
1 procedure TForm1.Button1Click(Sender: TObject);
2 var3 info: TScrollInfo;
4 begin5 fillchar(info, sizeof(info), 0);
6 with info do7 begin8 cbsize := sizeof(info);
9 fmask := SIF_ALL;
10 GetScrollInfo(stringgrid1.handle, SB_VERT, info);
11 fmask := fmask or SIF_PAGE;
12 nPage := 5 * (nmax - nmin) div stringgrid1.rowcount;
13 {whatever number of cells you consider a "page"}14 end;
15 setscrollinfo(stringgrid1.handle, SB_VERT, info, True);
16 end;