unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, CheckLst, Unit4;
type
TForm1 =
class(TForm)
CheckListBox1: TCheckListBox;
Button1: TButton;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
Formular: TForm;
Frames: TFrame4;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
iChecked, iZaehler, iGecheckteFrames, iY, iRunter, iErstellteFrames: Integer;
begin
Formular:=TForm.Create(Self);
Formular.ClientHeight := 1500;
Formular.ClientWidth := 670;
iGecheckteFrames := 0;
iY := 0;
iRunter := 0;
iZaehler := 0;
for ichecked := 0
to CheckListBox1.Items.Count-1
do
if CheckListBox1.Checked[ichecked]
then
if iGecheckteFrames = 14
then
begin
ShowMessage('
Zwischenablage drucken + aktuelle Form drucken');
end
else
begin
if iZaehler = 10
then
begin
ShowMessage('
Formular in Zwischenablage kopieren + Formular leeren');
iZaehler := 0;
iGecheckteFrames:= iGecheckteFrames + 1;
if iGecheckteFrames = 14
then
begin
ShowMessage('
Zwischenablage drucken + aktuelle Form leeren')
end;
end
else
begin
if iZaehler = 0
then
begin
Frames := TFrame4.Create(Self);
Frames.
Name := CheckListBox1.Items[ichecked];
Frames.ClientHeight := 200;
Frames.Top := iY;
Frames.Parent := Formular;
iZaehler := iZaehler + 1;
iGecheckteframes := iGecheckteframes + 1;
if iGecheckteFrames = 14
then
begin
ShowMessage('
Zwischenablage drucken und aktuelle Form drucken');
end;
end
else
begin
if iZaehler <= 4
then
begin
Frames := TFrame4.Create(Self);
Frames.
Name := CheckListBox1.Items[ichecked];
Frames.ClientHeight := 200;
Frames.Top := iY + Frames.ClientHeight;
iY := Frames.Top;
Frames.Parent := Formular;
iZaehler := iZaehler + 1;
iGecheckteFrames := iGecheckteFrames + 1;
if iGecheckteFrames = 14
then
begin
ShowMessage('
Zwischenablage drucken + aktuelle Form drucken');
end;
end
else
begin
if iZaehler = 5
then
begin
Frames := TFrame4.Create(Self);
Frames.
Name := CheckListBox1.Items[ichecked];
Frames.ClientHeight := 200;
Frames.Left := 350;
Frames.Parent := Formular;
iZaehler := iZaehler + 1;
iGecheckteframes := iGecheckteframes + 1;
end
else
begin
Frames := TFrame4.Create(Self);
Frames.
Name := CheckListBox1.Items[ichecked];
Frames.ClientHeight := 200;
Frames.Left := 350;
Frames.Top := iRunter + Frames.ClientHeight;
iRunter:= Frames.Top;
Frames.Parent := Formular;
iZaehler := iZaehler + 1;
iGecheckteFrames := iGecheckteFrames + 1;
if iGecheckteFrames = 14
then
begin
ShowMessage('
Zwischenablage drucken + aktuelle Form drucken');
end;
end;
end;
end;
end;
end;
Formular.Show;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
CheckListBox1.Items.Add('
a1');
CheckListBox1.Items.Add('
a2');
CheckListBox1.Items.Add('
a3');
CheckListBox1.Items.Add('
a4');
CheckListBox1.Items.Add('
a5');
CheckListBox1.Items.Add('
a6');
CheckListBox1.Items.Add('
a7');
CheckListBox1.Items.Add('
a8');
CheckListBox1.Items.Add('
a9');
CheckListBox1.Items.Add('
a10');
CheckListBox1.Items.Add('
a11');
CheckListBox1.Items.Add('
a12');
CheckListBox1.Items.Add('
a13');
CheckListBox1.Items.Add('
a14');
end;
end.