Public bool tabControlCheckHave (System. windows. forms. tabControl tab, String tabName) {for (int I = 0; I <tab. tabCount; I ++) {if (tab. tabPages [I]. text = tabName) {tab. selectedIndex = I; return true;} return false;} public void Add_TabPage (string str, Form myForm) {if (tabControlCheckHave (this. tabControl1, str) {return;} else {tabControl1.TabPages. add (str); tabControl1.SelectTab (tabControl1.TabPages. count-1); myForm. formBorderStyle = FormBorderStyle. none; myForm. topLevel = false; myForm. show (); myForm. parent = tabControl1.SelectedTab; tabControl1.SelectedTab. autoScroll = true ;}} private void BindTabPage (LB002 lb) {Add_TabPage ("basic parameters", new frmTypeParameter (lb); Add_TabPage ("Model cabin ", new frmAircraftCabin (); Add_TabPage ("basic parameters", new frmTypeParameter (lb); Add_TabPage ("Model cabin", new frmAircraftCabin (lb )); add_TabPage ("bulktankjoint (); Add_TabPage (" container ", new frmContainer (); Add_TabPage (" unit ", new frmStandardUnitConfigurationInformation ()); add_TabPage ("machine supply", new frmJiGongPinInformation (lb); Add_TabPage ("oil volume index range", new frmOilIndex (lb); Add_TabPage ("Center of Gravity package range ", new frmCenterOfGravityEnvelope (); Add_TabPage ("optimal Center of Gravity range", new frmBestWeight (lb); Add_TabPage ("Allocation value", new frmBalancingValue ()); add_TabPage ("Special Project", new frmStretcherSeatInformation (); Add_TabPage ("dashboard", new frmBoardBoxes (); Add_TabPage ("side balance & side imbalance ", new frmSideOfBalance (); Add_TabPage ("class information", new frmShippingSpaceInformation (); Add_TabPage ("tail tank", new frmTailOilTank (lb ));}
This article from the "stupid bird first fly" blog, please be sure to keep this source http://20120715.blog.51cto.com/3047132/1278148