OnAnimate Event example for C++ Builder

This example shows how the OnAnimate event can be used to toggle the use of a button to start and stop the animation.

procedure TForm1.Lead1Animate(Sender: TObject; bEnable: Wordbool);
{
   if( bEnable == True)
      Button1->Caption = "Stop Animation" ;
   else
      Button1->Caption = "Start Animation";
}
procedure TForm1.Button1Click(Sender: TObject);
{
   if( Lead1->AnimationEnable == True)
      Lead1->AnimationEnable = False;
   else
      Lead1->AnimationEnable = True;
}