ActiveControl (Delphi)
Description
Place a TTimer object on the form and enter Timer1Timer in the OnTimer event. Place other controls on the form and change the active control at run time. The following event handler responds to timer events by moving the active control one pixel to the right every 100 milliseconds.
Code
procedure TForm1.Timer1Timer(Sender: TObject);
begin
Timer1.Interval := 100;
if ActiveControl <> nil then
ActiveControl.Left := ActiveControl.Left + 1;
end;
Uses
- Vcl.Forms.TCustomForm.ActiveControl ( fr | de | ja )
- Vcl.ExtCtrls.TTimer.OnTimer ( fr | de | ja )
- Vcl.ExtCtrls.TTimer.Interval ( fr | de | ja )
- Vcl.Controls.TControl.Left ( fr | de | ja )