/// <summary> /// Creates a new export function tab for the specified function. /// </summary> /// <param name="name"></param> /// <param name="select"></param> /// <param name="function"></param> public void addExportFunctionTab(string name, bool select, oFunction function) { // Create the new oTab class and tab page oTabExportFunction tabExportFunction = new oTabExportFunction(this, toolStrip, panelMain, mainToolStrip, name, function); tabs.Add(tabExportFunction); tabController.TabPages.Add(tabExportFunction.WorkingPage); tabExportFunction.WorkingPage.ImageIndex = tabController.ImageList.Images.IndexOfKey(@"Export.ico"); if (select) { // Deactivate the selected tab if (tabController.SelectedIndex >= 0 && tabController.SelectedIndex < tabController.TabPages.Count) { tabs[tabController.SelectedIndex].deactivate(); } // Select the new tab page tabController.SelectedIndex = tabs.Count - 1; tabs[tabs.Count - 1].activate(); } }
/// <summary> /// Creates a new export function tab for the specified function. /// </summary> /// <param name="name"></param> /// <param name="select"></param> /// <param name="function"></param> public void addExportFunctionTab(string name, bool select, oFunction function) { // Create the new oTab class and tab page oTabExportFunction tabExportFunction = new oTabExportFunction(this, toolStrip, panelMain, mainToolStrip, name, function); tabs.Add(tabExportFunction); tabController.TabPages.Add(tabExportFunction.WorkingPage); tabExportFunction.WorkingPage.ImageIndex = tabController.ImageList.Images.IndexOfKey(@"Export.ico"); if (select) { // Deactivate the selected tab if (tabController.SelectedIndex >= 0 && tabController.SelectedIndex < tabController.TabPages.Count) tabs[tabController.SelectedIndex].deactivate(); // Select the new tab page tabController.SelectedIndex = tabs.Count - 1; tabs[tabs.Count - 1].activate(); } }