Информатика. Программирование в Delphi
173
procedure TForm1.EditKeyPress(Sender: TObject; var Key: Char);
var
Edit:TEdit;
begin
Edit:=Sender as TEdit;
case key of
'0'..'9',#8:;
',','.':
begin
key:=DecimalSeparator;
if pos(key,Edit.Text)<>0 then
key:=#0;
end;
'-':
if Edit.Tag=0 then
begin
if pos(key,Edit.Text)=0 then
Edit.Text:='-'+Edit.Text;
key:=#0;
end
else
key:=#0;
else
key:=#0;
end;
end;
procedure TForm1.EditChange(Sender: TObject);
begin
ListBox1.Items.Clear;
ListBox2.Items.Clear;
Button1.Enabled:=false;
if (Edit1.Text<>'') and (Edit1.Text<>'-') and
(Edit2.Text<>'') and (Edit2.Text<>'-') and
(Edit3.Text<>'') and (StrToFloat(Edit3.Text)<>0) then
if StrToFloat(Edit1.Text)>StrToFloat(Edit2.Text) then
begin
ListBox(ListBox1,StrToFloat(Edit1.Text),StrToFloat(Edit2.Text),
StrToFloat(Edit3.Text));
ListBox(ListBox2,StrToFloat(Edit1.Text),StrToFloat(Edit2.Text),
StrToFloat(Edit3.Text));
ListBox1.ItemIndex:=0;
ListBox2.ItemIndex:=ListBox2.Items.Count-1;
Button1.Enabled:=true;
end;
end;
I...,163,164,165,166,167,168,169,170,171,172 174,175,176,177,178,179,180,181,182,183,...370