Реферат: Созание компоненты
end;
constructor TNEdit1.Create(AOwner : TComponent);
begin
inherited Create(AOwner);
end;
function TNEdit1.getNum : Single;
begin
try
Result := StrToFloat(text);
except begin
Result := 0;
text := '';
end;
end;
end;
procedure TNEdit1.setNum(val: Single);
begin
EditNumber:=val;
text:=FloatToStr(val);
end;
procedure TNEdit1.KeyPress(var key:char);
begin
case key of
'0'..'9', #13, #8: ;
'-' : if Length(text)<>0 then key := #0;
else
if not ((key=DecimalSeparator)and(pos(DecimalSeparator,text)=0)) then Key:=#0;
end;
inherited KeyPress(key);