有没有人知道这个技巧,如何在其事件处理程序中自由控制?根据delphi帮助它是不可能的......
当Self.Text =''时,我想释放动态创建的TEdit.
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;
Run Code Online (Sandbox Code Playgroud)
应该怎样做才能达到同样的效果?
感谢名单
delphi ×1