__fastcall TForm1::TForm1(Tcomponent* Owner)
: Tform(Owner)
{
LONG dwStyle = GetWindowLong(Edit1->Handle, GWL_STYLE); SetWindowLong(Edit1->Handle, GWL_STYLE, dwStyle | ES_NUMBER);
}
void __fastcall TForm1::Edit1OnKeyPress(TObject *Sender, char &Key)
{
AnsiString InputKey = Key;
AnsiString ValidKey = AnsiString("0123456789.");
if (ValidKey.Pos(InputKey) == 0) {
Key = 0;
}
}