Hi,
I want to use a SpinEdit control, but the defauilt behaviour is driving me mad! I want the user to be able to type a value, in addition to using the up/down buttons. I want the OnChange handler to process the value entered. The buttons work OK, but as soon as the user types a value an exception is raised (presumably when the spin edit box is cleared) - "ECOnvertError '' is not a valid integer value". This happens in the OnChange handler when an attempt is made to access the value in the SpinEdit. Can anyone suggest a way to fix this? (Delphi 4).
N.B. I have tried the following code, which does NOT work:
procedure TForm.SpinChange(Sender: TObject);
var Value : Integer;
begin
try
Value:= Spin.Value;
except
on EConvertError do Value := 0;
end;
Process(Value);
end;
Please Help!!
I want to use a SpinEdit control, but the defauilt behaviour is driving me mad! I want the user to be able to type a value, in addition to using the up/down buttons. I want the OnChange handler to process the value entered. The buttons work OK, but as soon as the user types a value an exception is raised (presumably when the spin edit box is cleared) - "ECOnvertError '' is not a valid integer value". This happens in the OnChange handler when an attempt is made to access the value in the SpinEdit. Can anyone suggest a way to fix this? (Delphi 4).
N.B. I have tried the following code, which does NOT work:
procedure TForm.SpinChange(Sender: TObject);
var Value : Integer;
begin
try
Value:= Spin.Value;
except
on EConvertError do Value := 0;
end;
Process(Value);
end;
Please Help!!