Hi,
With TEdit, I want to put '-' just before and after numbers like that.
-123 or 123-
NOT like -12-3, 123--, -123-
I wrote the code provided below but this one can control '-' put only before numbers.
(OnKeyPress event)
if (Key = '-') and (Edit1.SelStart <> 0) then
begin
Key := #0;
end;
I want to improve or rewrite the code so that '-' can be put just after numbers too.
Is it possible?
Thank you in advance !
With TEdit, I want to put '-' just before and after numbers like that.
-123 or 123-
NOT like -12-3, 123--, -123-
I wrote the code provided below but this one can control '-' put only before numbers.
(OnKeyPress event)
if (Key = '-') and (Edit1.SelStart <> 0) then
begin
Key := #0;
end;
I want to improve or rewrite the code so that '-' can be put just after numbers too.
Is it possible?
Thank you in advance !