Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, StdCtrls, ExtCtrls;
- type
- TForm1 = class(TForm)
- Edit1: TEdit;
- Shape1: TShape;
- Button2: TButton;
- Shape2: TShape;
- Shape3: TShape;
- Shape4: TShape;
- Label1: TLabel;
- Label2: TLabel;
- Bevel1: TBevel;
- GroupBox1: TGroupBox;
- ColorBox1: TColorBox;
- ColorBox2: TColorBox;
- ColorBox3: TColorBox;
- ColorBox4: TColorBox;
- StaticText1: TStaticText;
- StaticText2: TStaticText;
- StaticText3: TStaticText;
- StaticText4: TStaticText;
- procedure Button1Click(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- Form1: TForm1;
- implementation
- {$R *.dfm}
- procedure TForm1.Button1Click(Sender: TObject);
- var
- a :Integer;
- i: Integer;
- begin
- a:=strtoint(edit1.Text);
- for i:= 1 to a do
- begin
- shape1:= tshape.Create(self);
- shape1.Parent:=self;
- shape1.Brush.Color:=colorbox1.Selected;
- shape1.Visible:=true;
- shape1.Height:=20;
- shape1.Width:=20;
- shape1.Left:=400;
- shape1.Top:= -20 + i * 40;
- shape2:= tshape.Create(self);
- shape2.Parent:=self;
- shape2.Brush.Color:=colorbox2.Selected;
- shape2.Visible:=true;
- shape2.Height:=20;
- shape2.Width:=20;
- shape2.Left:=400;
- shape2.Top:= 0 + i * 40;
- shape3:= tshape.Create(self);
- shape3.Parent:=self;
- shape3.Brush.Color:=colorbox3.Selected;
- shape3.Visible:=true;
- shape3.Height:=20;
- shape3.Width:=20;
- shape3.Left:=420;
- shape3.Top:= -20 + i * 40;
- shape4:= tshape.Create(self);
- shape4.Parent:=self;
- shape4.Brush.Color:=colorbox4.Selected;
- shape4.Visible:=true;
- shape4.Height:=20;
- shape4.Width:=20;
- shape4.Left:=420;
- shape4.Top:= 0 + i * 40;
- end;
- end;
- end.
Advertisement
Add Comment
Please, Sign In to add comment