«« Site Rescued »»

While the site is still going to move from its current host, a new site will now take its place. More Info.

The new site may have less content, but the core will now remain. And it will now play nicely with phones! Keep an eye on the DelphiDabbler Blog for news.

» Help

Force a TEdit to accept only numeric input

   

I've seen the tip to make a TEdit accept only numbers but there is an easier way to do it. This is the function I use in my applications:

procedure SetEditNumeric(Handle: THandle);
begin
  SetWindowLong(Handle, GWL_STYLE,
    GetWindowLong(Handle, GWL_STYLE) or ES_NUMBER);
end;
Author: JM
Contributor: JM
Added: 2009-12-05
Last updated: 2009-12-05

« Return to contents »