424______________________________________________ 7

void _fastcall TEditLetNum::Clear()
(

Text = "";

FModified = false;

}

   ,       -
: ,        -
 .        . 
     OnKeyPress.    -
        TEdit.
     ,   ,    On. To
   OnKeyPress   KeyPress.   -
    ,       -
  ,        , 
  Sender.

,       OnKeyPress 
,  ,      :

(TObject *Sender, char &Key)

         -
     : char &Key.

 ,       
       protected :

void _fastcall Keypress(char &Key);

      :

void   fastcall TEditLetNum::KeyPress(char &Key)
(
Set <char, '0', '9'> Dig;

Dig  '0'  '1'  '2'  '3'  '4'  '5'
 ' 6 '  ' 7 '  ' 8 '  ' 9 ' ;

if ((! FEnableNum) && (Dig.Contains(Key)))
Key = 0;

if ((! FEnableLet) && !(Dig.Contains(Key)))
Key = 0;

if (Key != 0) FModified = true;

TEdit::KeyPress(Key) ;

)

      .  -
 ,    true   FModified.   -
  KeyPress  .

  (  Compile    . 7.3.)  -
  .    
  . 7.7.    EditLetNum,  Button 
 Clear (     Clear),  Label,  
   Modified  EditLetNum 1,   -

. 7.7

  
 