private void CreateNewTabPage(String currentFileName) { if (!File.Exists(currentFileName)) { MessageBox.Show("The file name received (" + currentFileName + ") points to an innexistent file", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } NoMousewheelTabPage t = new NoMousewheelTabPage(GetNewTabPageName()); t.AutoScroll = true; t.BackColor = Settings.Default.CircuitBackColor; t.Text = Path.GetFileNameWithoutExtension(currentFileName); tabControl.TabPages.Add(t); CircuitView cv = new CircuitView(currentFileName); cv.OnGateSelected += new CircuitView.GateSelectedEvent(cv_OnGateSelected); cv.Location = new Point(0, 0); cv.Dock = DockStyle.Fill; t.Controls.Add(cv); tabControl.SelectedTab = t; }
private void FileNew() { CircuitView cv = new CircuitView(); NoMousewheelTabPage tp = new NoMousewheelTabPage(GetNewTabPageName()); tp.Size = tabControl.Size; cv.Size = tabControl.Size; tp.AutoScroll = true; tp.BackColor = Settings.Default.CircuitBackColor; tp.Controls.Add(cv); cv.Dock = DockStyle.Fill; cv.OnGateSelected += new CircuitView.GateSelectedEvent(cv_OnGateSelected); tabControl.TabPages.Add(tp); tabControl.SelectedTab = tp; }