how can i make an EditBox or MaskedEdit accept only numerical characters.
if not (Key in ['0'..'9', '.', #8, #9]) then Key := #0;
Set up an OnKeyPress event for the edit box, and put the following in the event handler: if not (Key in ['0'..'9', '.', #8, #9]) then Key := #0;
SetWindowLong(Edit1.Handle, GWL_STYLE, GetWindowLong(Edit1.Handle, GWL_STYLE) or ES_NUMBER);