I am trying to make new stringgrid component, where i can only type numbers and i've got something like this:
procedure TStringGrid1.KeyPress(Sender: TObject; var Key: Char); var MyKeyDown : TKeyPressEvent; begin MyKeyDown := OnKeyPress; if Assigned(MyKeyDown) then begin if Key in ['0'..'9',#8, '-'] then Key := Key else Key := #0; MyKeyDown(Self, Key); end; end;of course it doesn't work, so what wrong is in this code? (compiler is not showing any errors.)
Edited by rqdo5, 18 December 2010 - 05:16 PM.


Sign In
Create Account

Back to top









