0

Hi,

I am using VS C++ 2005 express edition. I developed a simple GUI with a single tabControl (contain tabpages with some combobox).

I wish to add a button which able to add another tabpage which contain the same item as previous tabpages.

For example. my previous tabpage contain 2 combobox and 1 button. Now with a single button click I wish to add a new tabpage , then it will pop out a dialog box and prompt user to key in the name of the new tabpage, the items in the new tabpage is same as previous.

Can any pro fren show me the function to code it? Thanks in advance.

Regards,

Adrian

2
Contributors
3
Replies
4
Views
9 Years
Discussion Span
Last Post by Narue
0

>Can any pro fren show me the function to code it?
I imagine it would be something like this:

void button_Click ( Object^, System::EventArgs^ )
{
  tabControl->TabPages->Add ( gcnew TabPage ( "Dynamic Tab" ) );
}
0

Hi,

Thanks for reply, but the code you provided is juz add a new tabpage. I wish to create a new tabpage which have the same item as other tabpage.

Pls lend me some help....

Regards,
Adrian

0

I'd create a custom control that embeds all of the controls and functionality you currently have. Then you can easily add a new instance of the custom control to the new tab page's Controls list. Otherwise, you'll have to copy all of the controls on one of the old tab pages manually to the new tab page. Depending on the complexity of each page, this could be very tedious.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.