-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUnit2.pas
More file actions
47 lines (38 loc) · 867 Bytes
/
Unit2.pas
File metadata and controls
47 lines (38 loc) · 867 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls,unit1;
type
TForm2 = class(TForm)
Label1: TLabel;
Edit1: TEdit;
Button1: TButton;
procedure Edit1KeyPress(Sender: TObject; var Key: Char);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
implementation
{$R *.dfm}
procedure TForm2.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
if not(key in ['0'..'9',#8])then key:=#0;
end;
procedure TForm2.Button1Click(Sender: TObject);
begin
if (form2.Edit1.text='') then
begin
showMessage('Ââåäèòå êîððåêòíóþ íà÷àëüíóþ âåðøèíó!');
exit;
form2.Close;
end
else
form1.buf.Caption:=edit1.Text;
form2.Close;
end;
end.