• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 183
  • Last Modified:

Which method do I need to use to scroll a Grid control up or down?

Hi!!! I need to scroll in my program the grid control, 1 row up or 1 row down.. how can I do that?

Thanks in advance
Jaime
0
skel
Asked:
skel
1 Solution
 
erajojCommented:
Hi,
If you're using TStringGrid (or decendant):

procedure TForm1.Button3Click(Sender: TObject); // scroll up
begin
  with StringGrid1 do if TopRow < RowCount - VisibleRowCount then TopRow := TopRow  + 1;
end;

procedure TForm1.Button4Click(Sender: TObject); // scroll down
begin
  with StringGrid1 do if TopRow > FixedRows then TopRow := TopRow  - 1;
end;

/// John
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now