我有一个表单,用于显示一些信息几秒钟.表单可以自由释放吗?我可以在构造函数中启动一个计时器,然后在timer-event中调用self.free吗?或者这可能会导致麻烦吗?
有没有人知道这个技巧,如何在其事件处理程序中自由控制?根据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)
应该怎样做才能达到同样的效果?
感谢名单