Papermind

graf warna

Jan 2nd, 2018
292
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 1.73 KB | None | 0 0
  1. interface
  2.  
  3. uses
  4.   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  5.   Dialogs, StdCtrls, ExtCtrls;
  6.  
  7. type
  8.   TForm1 = class(TForm)
  9.     Edit1: TEdit;
  10.     Shape1: TShape;
  11.     Button2: TButton;
  12.     Shape2: TShape;
  13.     Shape3: TShape;
  14.     Shape4: TShape;
  15.     Label1: TLabel;
  16.     Label2: TLabel;
  17.     Bevel1: TBevel;
  18.     GroupBox1: TGroupBox;
  19.     ColorBox1: TColorBox;
  20.     ColorBox2: TColorBox;
  21.     ColorBox3: TColorBox;
  22.     ColorBox4: TColorBox;
  23.     StaticText1: TStaticText;
  24.     StaticText2: TStaticText;
  25.     StaticText3: TStaticText;
  26.     StaticText4: TStaticText;
  27.     procedure Button1Click(Sender: TObject);
  28.   private
  29.     { Private declarations }
  30.   public
  31.     { Public declarations }
  32.   end;
  33.  
  34. var
  35.   Form1: TForm1;
  36.  
  37. implementation
  38.  
  39. {$R *.dfm}
  40.  
  41. procedure TForm1.Button1Click(Sender: TObject);
  42. var
  43. a :Integer;
  44. i: Integer;
  45. begin
  46.  
  47. a:=strtoint(edit1.Text);
  48. for i:= 1 to a do
  49.  begin
  50. shape1:= tshape.Create(self);
  51. shape1.Parent:=self;
  52. shape1.Brush.Color:=colorbox1.Selected;
  53. shape1.Visible:=true;
  54. shape1.Height:=20;
  55. shape1.Width:=20;
  56. shape1.Left:=400;
  57. shape1.Top:= -20 + i * 40;
  58.  
  59. shape2:= tshape.Create(self);
  60. shape2.Parent:=self;
  61. shape2.Brush.Color:=colorbox2.Selected;
  62. shape2.Visible:=true;
  63. shape2.Height:=20;
  64. shape2.Width:=20;
  65. shape2.Left:=400;
  66. shape2.Top:= 0 + i * 40;
  67.  
  68. shape3:= tshape.Create(self);
  69. shape3.Parent:=self;
  70. shape3.Brush.Color:=colorbox3.Selected;
  71. shape3.Visible:=true;
  72. shape3.Height:=20;
  73. shape3.Width:=20;
  74. shape3.Left:=420;
  75. shape3.Top:= -20 + i * 40;
  76.  
  77. shape4:= tshape.Create(self);
  78. shape4.Parent:=self;
  79. shape4.Brush.Color:=colorbox4.Selected;
  80. shape4.Visible:=true;
  81. shape4.Height:=20;
  82. shape4.Width:=20;
  83. shape4.Left:=420;
  84. shape4.Top:= 0 + i * 40;
  85. end;
  86. end;
  87. end.
Advertisement
Add Comment
Please, Sign In to add comment