Subversion Repositories svnkaklik

Rev

Details | Last modification | View Log

Rev Author Line No. Line
6 kaklik 1
unit Unit1;
2
 
3
interface
4
 
5
uses
6
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
7
  Dialogs, StdCtrls, ExtCtrls, ToolWin, ComCtrls;
8
 
9
type
10
  TForm1 = class(TForm)
11
    PaintBox1: TPaintBox;
12
    Button1: TButton;
13
    Button2: TButton;
14
    procedure Button1Click(Sender: TObject);
15
    procedure Button2Click(Sender: TObject);
16
 
17
  private
18
    { Private declarations }
19
  public
20
    { Public declarations }
21
  end;
22
 
23
var
24
  Form1: TForm1;
25
 
26
implementation
27
 
28
{$R *.dfm}
29
 
30
procedure TForm1.Button1Click(Sender: TObject);
31
begin
32
    with PaintBox1 do begin
33
    Canvas.Brush.Color := clRed;
34
    Canvas.Brush.Style := bsDiagCross;
35
    Canvas.Ellipse(0, 0, PaintBox1.Width, PaintBox1.Height);
36
  end;
37
end;
38
 
39
procedure TForm1.Button2Click(Sender: TObject);
40
var Y: Integer;
41
 
42
begin
43
 
44
  { first call FillRect to paint the surface of the form.
45
  this removes any previously drawn lines (and anything else!) }
46
  PaintBox1.Canvas.FillRect(ClientRect);
47
  PaintBox1.Canvas.MoveTo(0, 0);
48
  PaintBox1.Canvas.LineTo(PaintBox1.Width,PaintBox1.Height);
49
 
50
 
51
end;
52
 
53
end.