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; } CircuitView cv = new CircuitView(currentFileName); NoMousewheelTabPage t = new NoMousewheelTabPage(GetNewTabPageName()); t.AutoScroll = true; t.BackColor = Settings.Default.CircuitBackColor; t.Text = Path.GetFileNameWithoutExtension(currentFileName); tabControl.TabPages.Add(t); cv.Size = t.Size; cv.OnGateSelected += new CircuitView.GateSelectedEvent(cv_OnGateSelected); cv.Location = new Point(0, 0); cv.Dock = DockStyle.None; t.Controls.Add(cv); tabControl.SelectedTab = t; cv.ResizeAtLoad(); }