begin
ShowMessage ('Good Luck!!!');
form1. Hide;
end;
*при закрытии программы выводится сообщение:
procedure TForm1. Memo1Click (Sender: TObject);
begin
Button1. Visible:= true;
end;
procedure TForm1. Button1Click (Sender: TObject);
begin
Memo1. Visible:= false;
Button1. Visible:= false;
end;
procedure TForm1. FormDblClick (Sender: TObject);
begin
Button3. Visible:= false;
end;
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, StdCtrls, CheckLst;
type
TForm2 = class(TForm)
Button1: TButton;
Button2: TButton;
Button3: TButton;
ComboBox1: TComboBox;
Edit1: TEdit;
Edit2: TEdit;
Label1: TLabel;
Label2: TLabel;
procedure Button2Click (Sender: TObject);
procedure FormHide (Sender: TObject);
procedure FormClose (Sender: TObject; var Action: TCloseAction);
procedure Button3Click (Sender: TObject);
procedure Button1Click (Sender: TObject);
private
{Private declarations}
public
{Public declarations}
end;
var
Form2: TForm2;
implementation
uses fil, Math;
{$R *.dfm}
*процедура создания нового дилера
procedure TForm2. Button2Click (Sender: TObject);
var
q: string;
w: TextFile;
begin
q:= Edit1. Text + ' ' + Edit2. Text;
Form2. ComboBox1. Items. Add(q);
Form2. Close;
Form1. ComboBox3. Items. Add(q);
AssignFile (w, 'c:\file.txt');
If not FileExists ('c:\file.txt')
Then Rewrite(w)
else Append(w);
Writeln (w, Edit1. Text + ' ' + Edit2. Text);
CloseFile(w);
end;
procedure TForm2. FormHide (Sender: TObject);
begin
Form1. Visible:= true;
end;
procedure TForm2. FormClose (Sender: TObject; var Action: TCloseAction);
begin
Form1. Visible:= true;
end;
procedure TForm2. Button3Click (Sender: TObject);
begin
Hide;
end;
procedure TForm2. Button1Click (Sender: TObject);
*процедураудалениядилера
begin
ComboBox1. Items. Delete (ComboBox1. ItemIndex);
ComboBox1. Items. SaveToFile ('c:\file.txt');
form1. ComboBox3. Items. LoadFromFile ('c:\file.txt');
ComboBox1. Items. LoadFromFile ('c:\file.txt');
hide;
end;
end.