PageControlChange (C++)
Description
This project requires a Page Control. You need to populate the Page Control by right-clicking and selecting New Page from the context menu. As the tabs are selected by the user, the Page Control OnChange event fires, which causes the form caption to display the captions of each of the TTabSheets attached to the Page Control. Note the use of the Form�s OnShow event handler to set the caption when the form first appears. This occurs before any changes trigger the OnChange event of the Page Control.
Code
void __fastcall TForm1::PageControl1Change(TObject *Sender)
{
Caption = String(L"Now working on tab: " + PageControl1->ActivePage->Caption);
}
void __fastcall TForm1::FormShow(TObject *Sender)
{
PageControl1Change(Sender);
}
Uses
- Vcl.ComCtrls.TCustomTabControl.OnChange ( fr | de | ja )
- Vcl.Forms.TCustomForm.OnShow ( fr | de | ja )