int isOdd;
void __fastcall TForm1::FormCreate(TObject *Sender)
{
Image2->Visible=False;
Image3->Visible=False;
Image2->AutoSize=True;
Image3->AutoSize=True;
Timer1->Interval = 0;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Timer1Timer(TObject *Sender)
{
if (isOdd % 2 == 1)
{
Image1 ->Picture= Image2->Picture;
isOdd++;
}
else
{
Image1->Picture = Image3->Picture;
isOdd--;
}
// Image1->Left = Image1->Left - 10;
if(Image1->Left <= -Image1->Width)
Image1->Left = Width;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
Timer1->Interval = 150;
isOdd = 1;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormCreate(TObject *Sender)
{
Image2->Visible=False;
Image3->Visible=False;
Image2->AutoSize=True;
Image3->AutoSize=True;
Timer1->Interval = 0;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Timer1Timer(TObject *Sender)
{
if (isOdd % 2 == 1)
{
Image1 ->Picture= Image2->Picture;
isOdd++;
}
else
{
Image1->Picture = Image3->Picture;
isOdd--;
}
// Image1->Left = Image1->Left - 10;
if(Image1->Left <= -Image1->Width)
Image1->Left = Width;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
Timer1->Interval = 150;
isOdd = 1;
}
//---------------------------------------------------------------------------