public void RemoveTab(ImageTabPanel tab) { if (_openTabs.ContainsKey(tab.DenshaImage.Id)) { _openTabs.Remove(tab.DenshaImage.Id); this.TabPages.Remove(tab); tab.Dispose(); } }
void closeTabItem_Click(object sender, EventArgs e) { if (_imageTabPage != null) { ImageTabControl ctrl = _imageTabPage.Parent as ImageTabControl; ctrl.RemoveTab(_imageTabPage); _imageTabPage = null; } }
void closeAllTabsItem_Click(object sender, EventArgs e) { if (_imageTabPage != null) { ImageTabControl ctrl = _imageTabPage.Parent as ImageTabControl; ctrl.ClearTabs(); _imageTabPage = null; } }
public void AddTab(DenshaImage image) { if (_openTabs.ContainsKey(image.Id)) { ImageTabPanel tab = _openTabs[image.Id]; this.SelectTab(tab); } else { ImageTabPanel tab = new ImageTabPanel(image); this.TabPages.Add(tab); this.SelectTab(tab); _openTabs.Add(image.Id, tab); } }