TFrxEditControl Only Numbers

edited 11:26PM 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 11:26PM
    procedure Edit1OnKeyPress(Sender: TfrxComponent; var Key: Char);
    begin
      if not (Key in ['0'..'9', #8]) then Key := #0;                             
    end;
    
  • edited 11:26PM
    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

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.