ActiveControl (C++)
Description
Place a TTimer object on the form and type 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
void __fastcall TForm1::Timer1Timer(TObject *Sender)
{
Timer1->Interval = 100;
if (ActiveControl)
ActiveControl->Left = ActiveControl->Left + 1;
}
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 )