- •1 Тапсырма
- •2 Тапсырма
- •Interface
- •Implementation
- •Жұмыстың мақсаты:
- •1 Тапсырма
- •Interface
- •Interface
- •Implementation
- •1 Тапсырма
- •Implementation
- •1 Тапсырма
- •Interface
- •Implementation
- •Interface
- •Implementation
- •Interface
- •Implementation
- •Жұмыстың мақсаты:
- •Interface
- •Implementation
- •Анимация құру Жұмыстың мақсаты:
- •Interface
- •Implementation
- •10 Зертханалық жүмыс
- •Жұмыстың мақсаты:
- •Interface
- •Implementation
- •11 Зертханалық жұмыс Қойылымды қосымшаға құру Жұмыстың мақсаты:
- •1 Тапсырма
- •Interface
- •Implementation
- •Interface
- •Implementation
- •Interface
- •Implementation
- •Interface
- •Implementation
Interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, Buttons;
type
TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Panel1: TPanel;
Panel2: TPanel;
Panel3: TPanel;
Panel4: TPanel;
RedBar: TScrollBar;
GreenBar: TScrollBar;
BlueBar: TScrollBar;
BitBtn1: TBitBtn;
procedure RedBarChange(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure GreenBarChange(Sender: TObject);
procedure BlueBarChange(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
Implementation
{$R *.dfm}
procedure TForm1.RedBarChange(Sender: TObject);
begin
Panel1.Color:=TColorRef(RGB(BlueBar.Position,0,0));
Label1.Caption:=IntToStr
(RedBar.Position);
Panel4.Color:=TColorRef(RGB(RedBar.Position, GreenBar.Position, BlueBar.Position));
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Panel1.Color := RGB(RedBar.Position, 0 , 0);
Label1.Caption := IntToStr(RedBar.Position);
Panel2.Color := RGB(GreenBar.Position, 0 , 0);
Label2.Caption := IntToStr(GreenBar.Position);
Panel3.Color := RGB(BlueBar.Position, 0 , 0);
Label3.Caption := IntToStr(BlueBar.Position);
end;
procedure TForm1.GreenBarChange(Sender: TObject);
begin
Panel2.Color :=TColorRef(RGB(GreenBar.Position,0,0));
Label2.Caption := IntToStr(GreenBar.Position);
Panel4.Color := TColorRef(RGB(RedBar.Position, GreenBar.Position, BlueBar.Position))
end;
procedure TForm1.BlueBarChange(Sender: TObject);
begin
Panel3.Color :=TColorRef(RGB(BlueBar.Position,0,0));
Label3.Caption := IntToStr(BlueBar.Position);
Panel4.Color := TColorRef(RGB(RedBar.Position, GreenBar.Position, BlueBar.Position));
end;
end.
Қорытынды:
№7 зертханалық жұмыс
“Паскальдан тест” атты жобаны құру
Жұмыстың мақсаты:
Items және ItemIndex қасиеттер негізінде ListBox екі тізімнің өзара байланысын үйрену мен Label объектінде көпжолды жазуды құру
Бағдарламаның дайын түрі
Листинг бағдарламасы:
unit Unit1;
Interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.Buttons;
type
TForm1 = class(TForm)
ListBox1: TListBox;
ListBox2: TListBox;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
BitBtn1: TBitBtn;
procedure ListBox1KeyPress(Sender: TObject; var Key: Char);
procedure ListBox2KeyPress(Sender: TObject; var Key: Char);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Num1, Num2, CountR, Rez:integer;
Form1: TForm1;
Implementation
{$R *.dfm}
procedure TForm1.ListBox1KeyPress(Sender: TObject; var Key: Char);
begin
if key = #13 then
begin
Num1:= ListBox1.ItemIndex;
ListBox1.Enabled:= False;
ListBox2.Enabled:= True;
Form1.ActiveControl:= ListBox2;
end;
end;
procedure TForm1.ListBox2KeyPress(Sender: TObject; var Key: Char);
begin
If key = #13 then
begin
case ListBox2.ItemIndex of
0: Num2 := 1;
1: Num2 := 0;
2: Num2 := 3;
3: Num2 := 2;
4: Num2 := 5;
5: Num2 := 4;
6: Num2 := 7;
7: Num2 := 6;
8: Num2 := 9;
9: Num2 := 8
end
end;
if Num1 = Num2 then
begin
Label4.Caption := 'Дұрыc';
Rez := Rez + 1;
end
else Label4.Caption:= 'Қате';
CountR:= CountR + 1;
if CountR= 10 then
ShowMessage('Тест аяқталды.Баға:' + IntToStr(Rez div 2 + ord(Rez div 2 < 1)) + ('дұрыс жауаптар:' + IntToStr(Rez) + ''));
ListBox1.Enabled:= True;
ListBox2.Enabled:= False;
Form1.ActiveControl:= ListBox1;
ListBox1.Items.Delete(Num1);
ListBox1.Items.Insert(Num1, ' ');
end;
end.
Қорытынды:
№9 Зертханалық жұмыс
