Board index » cppbuilder » How to create pages for TPageControl at runtime?

How to create pages for TPageControl at runtime?


2004-01-11 01:47:30 AM
cppbuilder112
How can I create Pages for TPageControl at runtime?
TPageControl* PageControl = new TPageControl(MyForm);
PageControl->Parent = MyForm;
TTabSheet* TabSheet = new TTabSheet(PageControl);
TabSheet->Parent = PageControl;
This doesn't att TabSheet to PageControl.
Call PageControl->Pages[0] give "List index out of bounds"
 
 

Re:How to create pages for TPageControl at runtime?

Tanya wrote:
Quote
TTabSheet* TabSheet = new TTabSheet(PageControl);
TabSheet->Parent = PageControl;
Try this:
TTabSheet * TabSheet = new TTabSheet ( this );
TabSheet->PageControl = PageControl1;
TabSheet->Parent = PageControl1;
TabSheet->TabVisible = true; // maybe not needed
TabSheet->Visible = true; // maybe not needed
PageControl1->ActivePage = TabSheet;
Hans.
 

Re:How to create pages for TPageControl at runtime?

"Tanya" < XXXX@XXXXX.COM >wrote in message
Quote
TabSheet->Parent = PageControl;
Change that line to this instead:
TabSheet->PageControl = PageControl;
Gambit
 

{smallsort}

Re:How to create pages for TPageControl at runtime?

May you design all pages of the TPageControl, using "TabSheet->Visible =
true/false;" manage it available.
That will more Visual for you coding.
Regards.
"Tanya"
Quote
How can I create Pages for TPageControl at runtime?
TPageControl* PageControl = new TPageControl(MyForm);
PageControl->Parent = MyForm;

TTabSheet* TabSheet = new TTabSheet(PageControl);
TabSheet->Parent = PageControl;

This doesn't att TabSheet to PageControl.
Call PageControl->Pages[0] give "List index out of bounds"

 

Re:How to create pages for TPageControl at runtime?

There is an example in the following link that I hope it helps
www.geocities.com/rodolfofrino/ProgramSettings.html
Rodolfo
"Tanya" < XXXX@XXXXX.COM >wrote in message
Quote
How can I create Pages for TPageControl at runtime?
TPageControl* PageControl = new TPageControl(MyForm);
PageControl->Parent = MyForm;

TTabSheet* TabSheet = new TTabSheet(PageControl);
TabSheet->Parent = PageControl;

This doesn't att TabSheet to PageControl.
Call PageControl->Pages[0] give "List index out of bounds"