unit Unit4;
interface
uses
Winapi.Windows,
Winapi.Messages, System.SysUtils, System.Variants, System.Classes,
Vcl.Graphics,
Vcl.Controls,
Vcl.Forms,
Vcl.Dialogs,
Vcl.ExtCtrls;
type
TForm4 =
class(TForm)
ScrollBox1: TScrollBox;
Image1: TImage;
procedure FormCreate(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form4: TForm4;
FPanel : TPanel;
ydifferenz , xdifferenz ,x1,i,Tag1,k: integer;
implementation
{$R *.dfm}
procedure TForm4.FormCreate(Sender: TObject);
begin
//Form
Form4.Width := screen.Width;
form4.Top := screen.DesktopTop;
Form4.Height := screen.Height;
form4.Left := screen.DesktopLeft;
// Ydifferenz
xdifferenz := Form4.Width
div 31;
ydifferenz := form4.Height
div 12 ;
// Position Image
with image1
do
begin
left := scrollbox1.Left;
top := scrollbox1.top +(ydifferenz
div 2 );
width := form4.Width * 50;
end;
// Tag
Tag1 := trunc(image1.width / 365);;
x1 := trunc(Image1.width / 365);
for i := 0
to 365
do
begin
Fpanel := TPanel.Create(self);
with Fpanel
do
begin
left := x1 * i;
top := -ydifferenz
div 8;
height := ydifferenz
div 2;
width := Tag1;
parentbackground := false;
parent := scrollbox1;
visible := true;
Color := clsilver;
caption := inttostr(k);
end;
k := k+1;
end;
end;