Презентація на тему «Delphi»

unit Unit1;interfaceuses  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,  Dialogs;type  TForm1 = class(TForm)    Button1: TButton;    Label1: TLabel;  private    { Private declarations }  public    { Public declarations }  end;var  Form1: TForm1;implementation{$R *.dfm}end.
procedure TForm1.Button1Click(Sender: TObject);beginend;procedure TForm1.Label1MouseMove(Sender: TObject; Shift: TShiftState);beginend;
RadioButton 
Checkbox 
Button 
Memo 
Edit 
Label 
CheckListBox
Image
StringGrid
crHandPoint
OnClick
Events
Properties
Button1
Properties
Label1
F1
Properties
Form1
Object Inspector
2
1
3
4
Font
clMoneyGreen
Color
Caption
Properties
Label1
OnClick
Events
crHourGlass
Cursor
OnClick
Events
Font
Font
Caption
clSkyBlue
Color
crHandPoint
Cursor
Caption
Properties
Button2
Caption
Properties
Button1
F1
Name
Properties
Form1
Object Inspector
Caption
Properties
Button3
crHandPoint
Cursor
Font
OnClick
Events
Close;
OnClick
Events
Font
OnClick
Events
crAppStart
Cursor
Caption
Properties
Button6
crHourGlass
Cursor
OnClick
Events
Font
Font
crHandPoint
Cursor
Caption
Properties
Button5
Caption
Properties
Button4
Object Inspector
Form
Edit
Label
Font
Caption
Properties
Label1
OnClick
Events
crHandPoint
Cursor
OnClick
Events
Caption
Color
crHandPoint
Cursor
clGreen
Color
Properties
Label3
clRed
Color
Properties
Label2
F1_2
Name
Properties
Form1
Object Inspector
clYellow
Color
Properties
Label4
crHandPoint
Cursor
OnClick
Events
clBlue
Color
Properties
Label5
crHandPoint
Cursor
OnClick
Events
Caption
Properties
Label6
Object Inspector
False
Enabled
Properties
Memo1
procedure TForm1.Label2MouseMove(Sender: TObject; Shift: TShiftState; X,  Y: Integer);begin   Image1.Visible:=true;   Image2.Visible:=false;   Image3.Visible:=false;   Image4.Visible:=false;end;
Caption
Properties
Label3
Color
Font
Picture
Properties
Image1
True
Stretch
Text
Properties
Edit1
Font
Caption
Properties
Label2
Color
Font
Caption
Properties
Label1
Color
Font
Caption
Color
F1
Name
Properties
Form1
Object Inspector
2
Object Inspector
OnClick
Events
Font
crHandPoint
Cursor
Caption
Properties
Button1
1
3
Caption
Properties
Label3
Font
Caption
Properties
Label4
Font
Caption
Properties
Label2
Font
Font
Caption
Properties
Label1
Font
Caption
clSkyBlue
Color
Text
Properties
Edit1
F2
Name
Properties
Form1
Object Inspector
Caption
Properties
Button1
Cursor
Font
OnClick
Events
Object Inspector
OnClick
Events
Font
Cursor
Caption
Properties
Button2
Caption
Properties
Button1
OnClick
Events
False
Enabled
Text
Properties
Edit1
Caption
Properties
Label3
Lines
Properties
Memo1
Font
Caption
Properties
Label2
Caption
Properties
Label1
Caption
Form2_2
Name
Properties
Form1
Object Inspector
procedure TForm1.Button1Click(Sender: TObject);beginEdit3.Text:=Edit1.Text;Edit1.Text:='';end;
Caption
Properties
Label5
Color
Font
Text
Properties
Edit1
Caption
Properties
Label4
Color
Font
Caption
Properties
Label3
Color
Font
Caption
Properties
Label2
Color
Font
Font
Caption
Color
Caption
Properties
Label1
Form1
Name
Properties
Form1
Object Inspector
*
Caption
Properties
Button3
a:=StrToInt(Edit1.Text);b:=StrToInt(Edit2.Text);c:=a*b;Label5.Caption:=IntToStr(c);
OnClick
Events
-
Caption
Properties
Button2
a:=StrToInt(Edit1.Text);b:=StrToInt(Edit2.Text);c:=a-b;Label5.Caption:=IntToStr(c);
OnClick
Events
+
Caption
Properties
Button1
a:=StrToInt(Edit1.Text);b:=StrToInt(Edit2.Text);c:=a+b;Label5.Caption:=IntToStr(c);
OnClick
Events
C
Caption
Properties
Button4
Edit1.Text:='';Edit2.Text:='';
OnClick
Events
Object Inspector
 
procedure TForm1.Button4Click(Sender: TObject);s: integer;begins:=s+10;Label2.Caption:=IntToStr(s);end;
Caption
Properties
Button7
s:=s+100; Label2.Caption:=IntToStr(s);
OnClick
Events
Caption
Properties
Button1
s:=s+1; Label2.Caption:=IntToStr(s);
OnClick
Events
Caption
Properties
Button8
OnClick
Events
Object Inspector
2
1
3
4
Caption
Properties
Button1
OnClick
Events
Text
Properties
Edit1
Picture
Properties
Image1
True
Stretch
Caption
Properties
Label2
Caption
Caption
Properties
Label1
Form1
Name
Properties
Form1
Object Inspector
2
1
a=0 
b=0 
x1:=-c/b 
x1
d:=sqr(b)-4*a*c 
d<0 
d>0 
x1:=(-b+sqrt(d))/(2*a) 
x2:=(-b-sqrt(d))/(2*a) 
d, x1, x2 
x1:=-b/(2*a) 
d, x1 
2
1
20%
>20000
15%
10%
8%
5%
20%
>20000
15%
10%
8%
5%
Caption
Properties
Button1
procedure TForm1.Button1Click(Sender: TObject);var n, i, code: integer;p: integer;Beginn:=StrToInt(Edit1.Text);p:=1;for i:=1 to n dop:=p*i;Label3.Caption:= IntToStr(p);end;
OnClick
Events
Caption
Properties
Label3
Caption
Properties
Button2
Edit1.Text:='';Label3.Caption:='';
OnClick
Events
Text
Properties
Edit1
Caption
Properties
Label2
Caption
Properties
Label1
Caption
Properties
Form1
Object Inspector
2
1
Text
Properties
Edit1
Caption
Properties
Button1
OnClick
Events
Picture
Properties
Image1
True
Stretch
Caption
Properties
Label2
Caption
Properties
Label3
Caption
Properties
Label1
Caption
Properties
Form1
Object Inspector
Form 
Button
Label
CheckBox
Caption
Properties
Label3
Caption
Properties
CheckBox1
procedure TForm1.CheckBox1Click(Sender: TObject);beginend;
OnClick
Events
Caption
Properties
CheckBox2
procedure TForm1.CheckBox2Click(Sender: TObject);beginend;
OnClick
Events
Caption
Properties
Label2
Caption
Caption
Properties
Label1
Form1
Name
Properties
Form1
Object Inspector
Caption
Properties
Button1
OnClick
Events
Caption
Properties
Button2
OnClick
Events
Object Inspector
 
6
5
4
3
2
1
0
Text
Properties
Edit3
Caption
Properties
CheckBox1
procedure TForm1.CheckBox1Click(Sender:TObject);beginif CheckBox1.Checked=False thenbeginEdit1.Enabled:=False;Edit1.Text:='0';endelse Edit1.Enabled:=True;end;
OnClick
Events
0
Text
Properties
Edit1
0
Text
Properties
Edit2
Caption
Properties
Label3
Caption
Properties
Label2
Caption
Properties
Label1
Caption
Properties
Form1
Object Inspector
Caption
Properties
CheckBox2
procedure TForm1.CheckBox2Click(Sender:TObject);beginif CheckBox2.Checked=False thenbeginEdit2.Enabled:=False;Edit2.Text:='0';endelse Edit2.Enabled:=True;end;
OnClick
Events
Object Inspector
procedure TForm1.CheckBox3Click(Sender:TObject);beginif CheckBox3.Checked=False thenbeginEdit3.Enabled:=False;Edit3.Text:='0';endelse Edit3.Enabled:=True;end;
OnClick
Events
Caption
Properties
CheckBox3
Caption
Properties
Button1
OnClick
Events
Object Inspector
 
Caption
Properties
CheckBox1
OnClick
Events
Text
Properties
Edit1
Text
Properties
Edit2
Caption
Properties
Label3
Caption
Properties
Label2
Caption
Properties
Label1
Caption
Properties
Form1
Object Inspector
OnClick
Caption
Events
Properties
CheckBox2
Caption
Properties
CheckBox3
OnClick
Events
Object Inspector
Caption
Properties
Button1
Events
OnClick
Object Inspector
Form
Button
Label
Form
Button
Label
Memo
True
Options .goTabs
True
Options . AlwaysShowEditing
True
Options . goEditing
64
DefaultColWidth
24
DefaultRowHeight
1
RowCount
0
FixedCols
5
ColCount
StringGrid
2
1
Caption
Properties
Button1
procedure TForm1.Button1Click(Sender: TObject);var n, i, code: integer;p: integer;Beginn:=StrToInt(Edit1.Text);p:=1;for i:=1 to n dop:=p*i;Label3.Caption:= IntToStr(p);end;
OnClick
Events
Caption
Properties
Label3
Caption
Properties
Button2
Edit1.Text:='';Label3.Caption:='';
OnClick
Events
Text
Properties
Edit1
Caption
Properties
Label2
Caption
Properties
Label1
Caption
Properties
Form1
Object Inspector
2
1
3
Caption
Properties
Button1
OnClick
Events
Text
Properties
Edit1
Picture
Properties
Image1
True
Stretch
Caption
Properties
Label2
Caption
Caption
Properties
Label1
Form1
Name
Properties
Form1
Object Inspector
2
1
3
Caption
Properties
Button1
procedure TForm1.Button1Click(Sender: TObject);var n, i, code: integer;p: integer;Beginn:=StrToInt(Edit1.Text);p:=1;for i:=1 to n dop:=p*i;Label3.Caption:= IntToStr(p);end;
OnClick
Events
Caption
Properties
Label3
Caption
Properties
Button2
Edit1.Text:='';Label3.Caption:='';
OnClick
Events
Text
Properties
Edit1
Caption
Properties
Label2
Caption
Properties
Label1
Caption
Properties
Form1
Object Inspector
2
1
3
4
Caption
Properties
Button1
OnClick
Events
Text
Properties
Edit1
Picture
Properties
Image1
True
Stretch
Caption
Properties
Label2
Caption
Caption
Properties
Label1
Form1
Name
Properties
Form1
Object Inspector
2
1
3
Caption
Properties
Button1
OnClick
Events
Caption
Properties
Button2
OnClick
Events
Object Inspector
 
6
5
4
3
2
1
7
2
1
3
var  Form1: TForm1;  Ball,x,y:integer;implementation{$R *.dfm}procedure TForm1.Image1Click(Sender: TObject);begin  Ball:=ball+1;  Timer1.Interval:= Timer1.Interval-100;  Label2.Caption:=IntToStr(Ball);end;procedure TForm1.Button2Click(Sender: TObject);beginLabel2.Caption:=IntToStr(Ball);Timer1.Enabled:=False;end;procedure TForm1.FormCreate(Sender: TObject);begin   randomize;end;procedure TForm1.Button1Click(Sender: TObject);begin  Ball:=0;  Timer1.Enabled:=True;end;procedure TForm1.Timer1Timer(Sender: TObject);beginx:=random(400);y:=random(400);Image1.Left:=x;Image1.Top:=y;end; 
procedure TForm1.Image1Click(Sender: TObject);begin  Ball:=ball+1;  if RadioButton2.Checked=True then Timer1.Interval:= Timer1.Interval-100;  Label2.Caption:=IntToStr(Ball);end;
var  Form1: TForm1;  xm,ym,xk,yk,rxm,rym,rxk,ryk:integer;  r,r1,r2:real;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);beginRandomize;xm:=random(700);ym:=random(400);xk:=random(700);yk:=random(400); Image3.Left:=xm; Image3.Top:=ym;  Image3.Visible:=True; Image2.Left:=xk; Image2.Top:=yk;  Image2.Visible:=True; Timer1.Interval:=50; Timer1.Enabled:=True; rxm:=1; rym:=1; rxk:=1; ryk:=1;end;
procedure TForm1.Timer1Timer(Sender: TObject);beginxm := xm + 5*rxm;ym := ym + 5 * rym;If (xm >= 690) Or (xm <= 10) Then rxm := -rxm;If (ym <= 10) Or (ym >= 450) Then rym := -rym;Image3.Left:=xm;Image3.Top:=ym;xk := xk - 5 * rxk;yk := yk - 5 * ryk;If (xk >= 690) Or (xk <= 10) Then rxk := -rxk;If (yk <= 10) Or (yk >= 450) Then ryk := -ryk;Image2.Left:=xk;Image2.Top:=yk;  r := Sqrt(sqr(xm - xk)  + sqr(ym - yk) );  R1 := Sqrt(sqr(xm - 8) + sqr(ym - 420));  R2 := Sqrt(sqr(xm - 680) + sqr(ym - 368));        If r <= 40 Then            Begin            rxm := -rxm;            rym := -rym;            xm := xm + 5 * rxm;            ym := ym + 5 * rym;Image3.Left:=xm;Image3.Top:=ym;end;
procedure TForm1.Button1Click(Sender: TObject);begind1:=strToInt(Edit1.Text);d2:=strToInt(Edit2.Text);Edit3.Text:='';Edit4.Text:='';Label6.Caption:='';p:=1;zagchoslo:=random(d2-d1)+d1;end;
procedure TForm1.FormCreate(Sender: TObject);begin p:=1; randomize;end;
var  Form1: TForm1;  Ball,x,y:integer;implementation{$R *.dfm}procedure TForm1.Image1Click(Sender: TObject);begin  Ball:=ball+1;  Timer1.Interval:= Timer1.Interval-100;  Label2.Caption:=IntToStr(Ball);end;procedure TForm1.Button2Click(Sender: TObject);beginLabel2.Caption:=IntToStr(Ball);Timer1.Enabled:=False;end;procedure TForm1.FormCreate(Sender: TObject);begin   randomize;end;procedure TForm1.Button1Click(Sender: TObject);begin  Ball:=0;  Timer1.Enabled:=True;end;procedure TForm1.Timer1Timer(Sender: TObject);beginx:=random(400);y:=random(400);Image1.Left:=x;Image1.Top:=y;end; 
2
1
3
var  Form1: TForm1; 		  Ball,x,y:integer;implementation
procedure TForm1.FormCreate(Sender: TObject);begin   randomize;end;
procedure TForm1.Timer1Timer(Sender: TObject);beginx:=random(400);y:=random(400);Image1.Left:=x;Image1.Top:=y;end;end;
procedure TForm1.Image1Click(Sender: TObject);begin  Ball:=ball+1;  Label2.Caption:=IntToStr(Ball);end;
procedure TForm1.Button1Click(Sender: TObject);begin  Ball:=0;  Timer1.Enabled:=True;end;
procedure TForm1.Button2Click(Sender: TObject);beginLabel2.Caption:=IntToStr(Ball);Timer1.Enabled:=False;end;
procedure TForm1.Image1Click(Sender: TObject);begin  Ball:=ball+1;  if RadioButton2.Checked=True then Timer1.Interval:= Timer1.Interval-100;  Label2.Caption:=IntToStr(Ball);end;
Caption
Properties
Button1
OnClick
Events
Text
Properties
Edit1
Picture
Properties
Image1
True
Stretch
Caption
Properties
Label2
Caption
Caption
Properties
Label1
Form1
Name
Properties
Form1
Object Inspector
2
1
Caption
Properties
Button1
OnClick
Events
Caption
Properties
Button2
OnClick
Events
Object Inspector
 
6
5
4
3
2
1
7
Memo 
Edit 
Label 
Button 
Image
StringGrid
CheckListBox
RadioButton
Checkbox
ListBox
2
1
3
4
5
procedure TForm1.Button1Click(Sender: TObject);beginEdit3.Text:=Edit1.Text;Edit1.Text:='';end;
2
Object Inspector
OnClick
Events
Font
crHandPoint
Cursor
Caption
Properties
Button1
1
Button 
Image
StringGrid
RadioButton
Checkbox
ComboBox
ListBox
1
2
20%
>20000
15%
10%
8%
5%
Caption
Properties
Button1
OnClick
Events
Caption
Properties
Button2
OnClick
Events
Object Inspector
 
3
2
1
 
6
5
4
3
2
1
7
Caption
Properties
Button1
procedure TForm1.Button1Click(Sender: TObject);var n, i, code: integer;p: integer;Beginn:=StrToInt(Edit1.Text);p:=1;for i:=1 to n dop:=p*i;Label3.Caption:= IntToStr(p);end;
OnClick
Events
Caption
Properties
Label3
Caption
Properties
Button2
Edit1.Text:='';Label3.Caption:='';
OnClick
Events
Text
Properties
Edit1
Caption
Properties
Label2
Caption
Properties
Label1
Caption
Properties
Form1
Object Inspector
2
1
3
4
5
 
2
3
procedure TForm1.Button1Click(Sender: TObject);begind1:=strToInt(Edit1.Text);d2:=strToInt(Edit2.Text);Edit3.Text:='';Edit4.Text:='';Label6.Caption:='';p:=1;zagchoslo:=random(d2-d1)+d1;end;
True
Options .goTabs
True
Options . AlwaysShowEditing
True
Options . goEditing
64
DefaultColWidth
24
DefaultRowHeight
1
RowCount
0
FixedCols
5
ColCount
StringGrid
1
2
3
7
6
3
0
1
5
8
2
0
6
8
7
1
4
3
2
1
I,j