TFrxEditControl Only Numbers

edited 8:14AM in FastReport VCL 5
Hi Everyone,

I have a Dialog with some controls, I have a TFrxEditControl, but I need that it allow only numbers

In Delphi, a TEdit has a property "NumbersOnly", I can too handle it with OnKeyPress event handler
if not CharInSet (Key, ['0'..'9']) then
  Abort;

I can't use Abort in FR

How I can set the TFrxEditController to allow only numbers???? thanks a lot

Comments

  • gpigpi
    edited 8:14AM
    procedure Edit1OnKeyPress(Sender: TfrxComponent; var Key: Char);
    begin
      if not (Key in ['0'..'9', #8]) then Key := #0;                             
    end;
    
  • edited 8:14AM
    gpi wrote: »
    procedure Edit1OnKeyPress(Sender: TfrxComponent; var Key: Char);
    begin
      if not (Key in ['0'..'9', #8]) then Key := #0;                             
    end;
    


    thanks @gpi it works fine

Leave a Comment