unit FunctionErzeugungEdit;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 =
class(TForm)
Edit1: TEdit;
Edit2: TEdit;
Button1: TButton;
Button2: TButton;
Button3: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
private
procedure EditFeld;
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
edFeld:TEdit;
implementation
{$R *.dfm}
var v: Double;
function zylinder(r,h:Double):Double;
begin
Result:=pi*sqr(r) * h
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
form1.EditFeld;
try
v:=zylinder(strtofloat(edit1.Text), strtofloat(edit2.Text));
edfeld.Text:=floattostr(v)
except
edfeld.Text:='
Fehler, nur Zahlen eingeben'
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
edfeld.text:='
';
edfeld.Free;
end;
procedure tform1.EditFeld;
begin
edFeld:=tedit.Create(form1);
edFeld.Create(form1);
edFeld.Parent:=form1;
edFeld.
name:='
DOOOOOOF';
edFeld.SetBounds(200,200,80,20);
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
close
end;
end.