unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComCtrls, ExtCtrls;
type
TForm2 =
class(TForm)
PageControl1: TPageControl;
TabAbrech: TTabSheet;
procedure FormCreate(Sender: TObject);
private
{ Private-Deklarationen }
BoxScro: TScrollBox;
LBut:
array[0..3]
of TButton;
public
{ Public-Deklarationen }
procedure GenerateButton;
end;
var
Form2: TForm2;
implementation
{$R *.dfm}
procedure TForm2.GenerateButton;
var
i: Integer;
begin
BoxScro := TScrollBox.Create(TabAbrech);
BoxScro.Parent := TabAbrech;
//<<<<<<<<<<<<<<<<<<<<<
BoxScro.Align := alClient;
BoxScro.BorderStyle := bsNone;
//FrmOpen.CDS.First;
for i := 1
to High(Self.LBut)
do //FrmOpen.CDS.RecNo do
begin
LBut[i] := TButton.Create(BoxScro);
LBut[i].Parent := BoxScro;
LBut[i].Left := 20 + ((LBut[i].Height + 10) * i);
LBut[i].Height := 20;
if (i >= 5)
then
LBut[i].Height := 20 + ((LBut[i].Height + 10) * i);
LBut[i].Caption := IntToStr(LBut[i].Left);
// FrmOpen.CDS.FieldByName('speise').Value;
//FrmOpen.CDS.Next;
end;
end;
procedure TForm2.FormCreate(Sender: TObject);
begin
PageControl1.Align := alClient;
end;
end.