/*
OnCreate, OnClick, SelectNextPage example
This example requires a new TPageControl, as-is, with no new pages created at design time, and a TUpDown control, also from the Win95 page of the component palette.
The form OnCreate event handler adds several new TabSheet controls to the Page Control. 
The UpDown1Click event handler fires when the user clicks the up or down button on the TUpDown control.  The SelectNextPage method of the Page Control goes forward the comparison (Button = btNext) evaluates as true.  If Button is not btNext, the previous Tab Page is selected.
*/ 
void __fastcall TForm1::FormCreate(TObject *Sender)
{
  for (int i = 0; i < 10; i++)
  {
    TTabSheet *pPage = new TTabSheet(PageControl1);
    pPage->PageControl = PageControl1;
    pPage->Caption = AnsiString("Page") + IntToStr(i);
  }
}

void __fastcall TForm1::UpDown1Click(TObject *Sender, TUDBtnType Button)
{
  PageControl1->SelectNextPage(Button == btNext);
}
 
