
18.05.2009, 22:58
|
 |
Гуру
|
|
Регистрация: 09.03.2009
Адрес: На курорте, из окна вижу теплое Баренцево море. Бррр.
Сообщения: 4,723
Репутация: 52347
|
|
И что может неполучаться, поразительно.
dfm-файл
Код:
object Form24: TForm24
Left = 0
Top = 0
Caption = 'Form24'
ClientHeight = 339
ClientWidth = 635
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
PixelsPerInch = 96
TextHeight = 13
object Edit1: TEdit
Left = 32
Top = 32
Width = 121
Height = 21
TabOrder = 0
Text = 'Edit1'
OnKeyPress = Edit1KeyPress
end
end
Код:
unit Unit24;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm24 = class(TForm)
Edit1: TEdit;
procedure Edit1KeyPress(Sender: TObject; var Key: Char);
end;
var
Form24: TForm24;
implementation
{$R *.dfm}
procedure TForm24.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
if not (Key in ['0'..'9', #8]) then Key := #0;
end;
end.
__________________
Жизнь такова какова она есть и больше никакова.
Помогаю за спасибо.
|