private void tabServers_Selected(object sender, TabControlEventArgs e) { if (e.TabPage == tabAddServer) { int si = tabServers.SelectedIndex; ServerComponent uc = new ServerComponent(); uc.Dock = DockStyle.Fill; TabPage tp = new TabPage(); tp.Controls.Add(uc); tp.Text = "New Server"; tabServers.TabPages.Insert(tabServers.TabPages.Count - 1, tp); tabServers.SelectedIndex = si; } }
private void Sparc_Load(object sender, EventArgs e) { initXML(); ServerComponent uc = new ServerComponent(); uc.Dock = DockStyle.Fill; TabPage tp = new TabPage(); tp.Controls.Add(uc); tp.Text = "New Server"; tabServers.TabPages.Insert(tabServers.TabPages.Count - 1, tp); tabServers.SelectedIndex = 0; }