Ok,

Here is the procedure you stick into your library

procedure IL_Numeric_Only (Positive_Only : boolean; var Key: Char);
begin
  if Key in ['0'..'9','.',cBS]
  then exit;

  if (not Positive_Only) and (Key = '-')
  then exit;

  Key := #0;
end;

And here is the keypress event 

procedure TForm1.StringGrid1KeyPress(Sender: TObject; var Key: Char);
begin
  IL_Numeric_Only (false,Key);
end;


On  5 Mar 99 at 16:52, [EMAIL PROTECTED] wrote:

> 
> It's a string grid so that's no good.
> 

Rohit

======================================================================
CFL - Computer Fanatics Ltd.  21 Barry's Point Road, AKL, New Zealand
PH    (649) 489-2280 
FX    (649) 489-2290
email [EMAIL PROTECTED]  or  [EMAIL PROTECTED]
======================================================================

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to