private void newClient_Click(object sender, EventArgs e) { TabPage newTabPage = new TabPage(); clientControl newClient = new clientControl(); newTabPage.Controls.Add(newClient); newTabPage.Text = "Новый клиент"; ListTab.TabPages.Insert(ListTab.TabCount, newTabPage); ListTab.SelectedTab = newTabPage; }
private void clientDGV_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) { if (clientDGV.SelectedCells.Count > 0) { TabPage newTabPage = new TabPage(); currentClient = clientDGV.Rows[clientDGV.SelectedCells[0].RowIndex].DataBoundItem as cClient; clientControl newClient = new clientControl(currentClient); newTabPage.Controls.Add(newClient); newTabPage.Text = currentClient.fio; ListTab.TabPages.Insert(ListTab.TabCount, newTabPage); ListTab.SelectedTab = newTabPage; } }