adrianjohnson
Programmer
I've decided to have a play with Borland Turbo C++, and decided to write a multi-tab web browser (to help me understand the language, IDE etc.)
I've added a TPageControl to the form, with a TTabSheet, plus a button which I would like to use to add a new tab, with a web browser control in it.
I've managed to get it to add a new tab, but it won't add the web browser control. The code I have is below:
The line that says:
is the bit where I've tried to make the Tab Sheet or the Page Control the parent of the web browser, but it produces an error.
How can I get this to work?
Thanks,
Adrian
I've added a TPageControl to the form, with a TTabSheet, plus a button which I would like to use to add a new tab, with a web browser control in it.
I've managed to get it to add a new tab, but it won't add the web browser control. The code I have is below:
Code:
void __fastcall TForm1::Button2Click(TObject *Sender)
{
TTabSheet *pTabSheet = new TTabSheet(PageControl1);
pTabSheet->PageControl = PageControl1;
pTabSheet->Caption = "New Tab";
TWebBrowser * MyWebBrowser = new TWebBrowser(pTabSheet);
//Parent code
MyWebBrowser->Visible = true;
PageControl1->ActivePage = pTabSheet;
}
The line that says:
Code:
//Parent code
is the bit where I've tried to make the Tab Sheet or the Page Control the parent of the web browser, but it produces an error.
How can I get this to work?
Thanks,
Adrian