public FormImageFile(FormMaster master, TabPageCustom tabPage, string fileName) { InitializeComponent(); this.tabPage = tabPage; this.master = master; LoadForm(fileName); this.btnOpen.Text = Resource.btnOpenExplorer; this.btnClose.Text = Resource.btnCloseTab; }
public FormTextFile(FormMaster master, TabPageCustom tabPage, string fileName) { InitializeComponent(); this.TabStop = false; this.tabPage = tabPage; this.master = master; LoadForm(fileName); this.btnOpen.Text = Resource.btnOpenExplorer; this.btnClose.Text = Resource.btnCloseTab; this.btnSave.Text = Resource.btnSaveFile; this.originalText = this.btnSave.Text; }
public TabPageCustom AddTab(Form form, object tag, string text) { var textSuffix = (text == null ? "" : ": " + text); if (form is FormWebRequest) { text = "WebRequest" + textSuffix; } else if (form is FormCompare) { text = "Compare" + textSuffix; } else if (form is FormTextView) { text = "Editor" + textSuffix; } else if (form is FormJsonViewer) { text = "JSON" + textSuffix; } var tabpage = new TabPageCustom { Text = text }; tabpage.Tag = new Tag { Form = form, InternalTag = tag }; tabpage.BorderStyle = BorderStyle.Fixed3D; tabControl.TabPages.Add(tabpage); form.TopLevel = false; form.Parent = tabpage; form.Show(); form.Dock = DockStyle.Fill; tabControl.SelectedTab = tabpage; if (form is IFormFileUpdate formFile) { tabpage.CanClose = formFile.CanClose; } return(tabpage); }
public void CloseTab(TabPageCustom tab) { tabControl.TabPages.Remove(tab); tabControl.SelectLastTab(); }
internal void SelectTab(TabPageCustom tab) { this.tabControl.SelectedTab = tab; }
public Form GetForm(TabPageCustom tab) { return(((TabMaster.Tag)tab.Tag).Form); }
public Tag GetTag(TabPageCustom tab) { return((Tag)tab.Tag); }