unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls,Grids;
type
TForm1 = class(TForm)
StringGrid1: TStringGrid;
StringGrid2: TStringGrid;
procedure StringGrid2TopLeftChanged(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.StringGrid2TopLeftChanged(Sender: TObject);
begin
StringGrid1.LeftCol := StringGrid2.LeftCol;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
StringGrid1.ScrollBars:=ssVertical;
StringGrid1.Width:=StringGrid2.Width;
end;
end.