Click here to Skip to main content
15,887,335 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have build a tabbed Mdi application.MdiParent contains a toolstrip which has buttons like inventory,production etc.When this buttons are clicked the forms open inside the tabpage of the tabcontrol present in the mdiparent.Its working.Now i have toolstrip in suppose inventory form which contains buttons like procurement,purchase.I have to open the procurement form inside the tabcontrol present in inventory form.how to do that...
Posted

Why don't you just drop a tab control in one of the tabs? The child of a tab page in a tab control can itself be a tab control.
 
Share this answer
 
Comments
Kunal Singha Roy 26-Apr-11 8:10am    
But i am creating the tab pages in the tabcontrol during the run time
Nish Nishant 26-Apr-11 8:13am    
Yeah, and you can create and add a tab control at run time too.
Kunal Singha Roy 26-Apr-11 8:24am    
I have a problem that when the mdi child activate event is called then i am calling a function opennewchildform() where i am putting the form inside the tabpage of the tabcontrol.Now when i am trying to open procurement form in inventory then the same opennewchildform() function gets called from mdichild activate event so tabpage gets added to the tabcontrol in the mdiparent.
Nish Nishant 26-Apr-11 8:26am    
Set a flag to make sure that you only create the child control once. If the flag is true, then skip over the creation code.
Sergey Alexandrovich Kryukov 26-Apr-11 17:04pm    
Even if this is solved, the design will be ugly.
Please see my alternative.
--SA
If you create a TabControl is a tab, it would be too confusing from the customer experience point of view (even though it's quite easy technically). You need two levels? Good. Make them visually different. One such design can be based on master-detail in the form of ListBox/Panel, for example.

Imagine you have a tab page; inside a tab page a ListBox with items and some Panel of right. When you change selection in a list box, use System.Windows.Forms.CheckedListBox.SelectedIndexChanged event to look at the item and show appropriate instance of Panel on right side.

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900