ActiveControl (C++)

From RAD Studio Code Examples
Jump to: navigation, search


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.


void __fastcall TForm1::Timer1Timer(TObject *Sender)
  Timer1->Interval = 100;
  if (ActiveControl)
    ActiveControl->Left = ActiveControl->Left + 1;