Does anybody know the trick, how to free control inside its event handler ? According delphi help it is not possible...
I want to free dynamicaly created TEdit, when Self.Text=''.
TAmountEdit = class (TEdit)
.
.
public
procedure KeyUp(var Key: Word; Shift :TShiftState);
end;
procedure TAmountEdit.KeyUp(var Key: Word; Shift :TShiftState);
begin
inherited;
if Text='' then Free; // after calling free, an exception arises
end;
How should do to achieve the same effect?
Thanx
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…