Скачиваний:
83
Добавлен:
04.03.2014
Размер:
1.53 Кб
Скачать
unit Unit2;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, unit1, ExtCtrls, jpeg;

type
TForm2 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Button1: TButton;
Button2: TButton;
Edit3: TEdit;
Label3: TLabel;
Image1: TImage;
ComboBox1: TComboBox;
ComboBox2: TComboBox;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Edit3KeyPress(Sender: TObject; var Key: Char);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form2: TForm2;

implementation

{$R *.dfm}

procedure TForm2.Button1Click(Sender: TObject); {добавить}
var z:Tnom;
begin
if (combobox1.Items[Combobox1.Itemindex]='') or (combobox2.Items[Combobox2.Itemindex]='') or (Edit3.Text='') then showmessage('Введите данные')
else
begin
z.Name:=Combobox2.Items[Combobox2.Itemindex];
z.Cena:=Edit3.Text;
z.Cvet:=Combobox1.Items[Combobox1.Itemindex];
write(f,z);
Edit3.Clear;
Combobox2.Clear;
Combobox1.Clear;
Combobox2.SetFocus;
end;
end;

procedure TForm2.Button2Click(Sender: TObject); {закрыть}
begin
closefile(f);
Form1.Show;
Form2.Hide;
end;


procedure TForm2.Edit3KeyPress(Sender: TObject; var Key: Char);
begin
case key of
'0'..'9',#8:;
',','.':
begin
key:=Decimalseparator;
if Pos(key,edit3.Text)<>0 then key:=#0;
end;
else key:=#0;
end;
end;

end.
Соседние файлы в папке Типизированный файл. Тачки
  • #
    04.03.201416.42 Кб83Unit1.dcu
  • #
    04.03.201448.87 Кб83Unit1.dfm
  • #
    04.03.201410.31 Кб84Unit1.pas
  • #
    04.03.20146.1 Кб83Unit2.dcu
  • #
    04.03.201419.52 Кб83Unit2.dfm
  • #
    04.03.20141.53 Кб83Unit2.pas
  • #
    04.03.20144.45 Кб83Unit3.dcu
  • #
    04.03.20141 Кб83Unit3.dfm
  • #
    04.03.2014714 б83Unit3.pas