/// <summary> /// Return the current visible Page /// </summary> private bool ShowPage(CustomTabPage tab) { if (tab == null) { // just view an empty page m_PagePanel.SelectedTab = tab; m_LastPage = m_CurrentPage; m_CurrentPage = tab; return(true); } if (tab.Equals(m_CurrentPage)) { return(false); } if (!m_PagePanel.TabPages.Contains(tab)) { m_PagePanel.TabPages.Add(tab); } if (m_PagePanel.SelectedTab != tab) { m_PagePanel.SelectedTab = tab; } m_LastPage = m_CurrentPage; m_CurrentPage = tab; (m_CurrentPage.Page as IPage).ActivatePage(); return(true); }
public bool CreatePage(string sPageName, PageBase page, bool bIsStartPage = false) { if (m_dictPages.ContainsKey(sPageName)) { return(false); } CustomTabPage tab = new CustomTabPage(page); tab.Text = sPageName; m_dictPages.Add(sPageName, tab); if (bIsStartPage && m_StartPage == null) { m_StartPage = tab; return(true); } return(false); }
private void InitTabControl() { tcInfo.TabPages.Clear(); for (int i = 0; i < _threadParameters.Length; i++) { CustomTabPage tabPage = new CustomTabPage(); tabPage.Text = _threadParameters[i].SortMethod.ToString(); tabPage.AutoScroll = true; tabPage.TabPageControl.SorterName = _threadParameters[i].SortMethod.ToString(); tabPage.TabPageControl.SwapCount = _threadParameters[i].SortMethod.SwapCount.ToString(); tabPage.TabPageControl.ElementsCount = _threadParameters[i].ArrayForSorting.Length.ToString(); tabPage.TabPageControl.SortingTime = string.Format("{0:00}:{1:00}:{2:00}", _threadParameters[i].SortMethod.SortingTime.Hours, _threadParameters[i].SortMethod.SortingTime.Minutes, _threadParameters[i].SortMethod.SortingTime.Seconds); tabPage.TabPageControl.RatioTimeSizeButton.Click += RatioTimeSizeButton_Click; tabPage.TabPageControl.SortingTimeTxtLabel.Click += SortingTimeTxtLabel_Click; tcInfo.TabPages.Add(tabPage); } }