: Edit2.
: , ( OnKeyPress) . ( #0). case.
1 Object TreeViewEdit1
1Object Inspector ÌEvents OnKeyPress,
interface Edit2KeyPress(Sender: TObject; var Key: Char). implementation .
, , .
procedure TForm1.Edit2KeyPress(Sender: TObject; var Key: Char);
Begin
case Key of
'0'..'9':; // ,
',':; //
#8:; // <Backspace>
else Key:= Chr(0); //
End;
End;
- Key . ['0'..'9', '+', '-', ,, #8], - Key ( Chr(0) , #0).
else
0..9:
.
procedure TForm1.Edit2KeyPress(Sender: TObject; var Key: Char)
Key
,:
#8
Key:=Chr(0)
- -
.
StrToInt (S: String): Integer - S .
IntToStr (Value: Integer): String - Value .
StrToFloat (S: String): Extended - S .
StrToIntDef (S: String; Default: Integer): Integer- S , , Default, S.
FloatToStr (Value: Extended): String - Value .
FloatToStrF (Value: Extended; Format: TFloatFormat; Precision, Digits: Integer): String - Value Format.
Format:
ffExponent - ;
ffFixed - ;
ffGeneral - , ffFixed, > Precision, Value >= 0,00001, ffExponent.
Precision .
Digits - ,
Val(S: string; var V; var Code: Integer) - S V . Code = 0, . , Code .
|
|
TButton
TButton - . - OnClick ( ).
(properties) :
Cancel: Boolean - True, OnClick Esc.
Default: Boolean - True, OnClick Enter.
TButton Windows, - Windows. clBtnFace.
OnClick, .
Type
TForm1 = class (TForm)
.
Button1: TButton;
procedure Button1Click(Sender: TObject);
..
Implementation
..
procedure TForm1.Button1Click(Sender: TObject);
Begin
.
End;