Hi!
This (ugly demo) code works on Lazarus 1.6.4, but not on Lazarus 1.8.2.
Thanks...
unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
fpspreadsheetctrls, fpspreadsheetgrid,
fpsallformats;
type
{ TForm1 }
TForm1 = class(TForm)
Timer: TTimer;
WorkbookSource: TsWorkbookSource;
WorkbookTabControl: TsWorkbookTabControl;
procedure FormActivate(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure TimerTimer(Sender: TObject);
private
WorksheetGrid: TsWorksheetGrid;
public
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.FormCreate(Sender: TObject);
begin
Timer.Enabled:= false;
end;
procedure TForm1.FormActivate(Sender: TObject);
begin
WorkbookSource.FileName:= 'test_multi.xls';
with WorkbookTabControl do
begin
Align:= alClient;
WorkbookSource:= Self.WorkbookSource;
end;
WorksheetGrid:= TsWorksheetGrid.Create(self);
if Assigned(WorksheetGrid) then
with WorksheetGrid do
begin
Parent:= WorkbookTabControl;
Align:= alClient;
WorkbookSource:= Self.WorkbookSource;
Timer.Enabled:= true;
end;
end;
procedure TForm1.TimerTimer(Sender: TObject);
begin
Timer.Enabled:= false;
if WorkbookTabControl.TabIndex < WorkbookTabControl.Tabs.Count -1
then WorkbookTabControl.TabIndex:= WorkbookTabControl.TabIndex +1
else WorkbookTabControl.TabIndex:= 0;
Timer.Enabled:= true;
end;
end.